Skip to content

Update documentation to explain redisConnectWithOptions.#1099

Merged
michael-grunder merged 1 commit intomasterfrom
document-new-options
Sep 2, 2022
Merged

Update documentation to explain redisConnectWithOptions.#1099
michael-grunder merged 1 commit intomasterfrom
document-new-options

Conversation

@michael-grunder
Copy link
Collaborator

Additionally document the new REDIS_OPT_PREFER_IPV4,
REDIS_OPT_PREFER_IPV6 as well as the rest of our existing options.

See #1096

Additionally document the new `REDIS_OPT_PREFER_IPV4`,
`REDIS_OPT_PREFER_IPV6` as well as the rest of our existing options.

See #1096
@michael-grunder michael-grunder merged commit cc7c35c into master Sep 2, 2022
@michael-grunder michael-grunder deleted the document-new-options branch September 2, 2022 01:40
| --- | --- |
| REDIS\_OPT\_NONBLOCK | Tells hiredis to make a non-blocking connection. |
| REDIS\_OPT\_REUSEADDR | Tells hiredis to set the [SO_REUSEADDR](https://man7.org/linux/man-pages/man7/socket.7.html) socket option |
| REDIS\_OPT\_PREFER\_IPV4<br>REDIS\_OPT\_PREFER_IPV6 | Informs hiredis to either prefer `IPV4` or `IPV6` when invoking [getaddrinfo](https://man7.org/linux/man-pages/man3/gai_strerror.3.html). Note that both of the options may be set at once, which will cause hiredis to spcify `AF_UNSPEC` in the getaddrinfo call, which means both `IPV4` and `IPV6` addresses will be searched simultaneously. |
Copy link
Contributor

@zuiderkwast zuiderkwast Sep 2, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very nice!

We could also add an option like REDIS_OPT_PREFER_IP_UNSPEC which we simply define as REDIS_OPT_PREFER_IPV4 | REDIS_OPT_PREFER_IPV6 and use this in the documentation. WDYT?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, I can add that.

michael-grunder added a commit that referenced this pull request Sep 2, 2022
michael-grunder added a commit that referenced this pull request Sep 2, 2022
Add REDIS_OPT_PREFER_UNSPEC

See: #1099, #1096

Co-authored-by: Viktor Söderqvist <[email protected]>
Co-authored-by: Viktor Söderqvist <[email protected]>
Co-authored-by: Viktor Söderqvist <[email protected]>
TedLyngmo pushed a commit to TedLyngmo/hiredis that referenced this pull request Jul 9, 2025
Add REDIS_OPT_PREFER_UNSPEC

See: redis#1099, redis#1096

Co-authored-by: Viktor Söderqvist <[email protected]>
Co-authored-by: Viktor Söderqvist <[email protected]>
Co-authored-by: Viktor Söderqvist <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants