-
Notifications
You must be signed in to change notification settings - Fork 30k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
doc: fix family default value in socket.connect #28521
Conversation
@@ -618,8 +618,8 @@ For TCP connections, available `options` are: | |||
* `host` {string} Host the socket should connect to. **Default:** `'localhost'`. | |||
* `localAddress` {string} Local address the socket should connect from. | |||
* `localPort` {number} Local port the socket should connect from. | |||
* `family` {number}: Version of IP stack, can be either `4` or `6`. | |||
**Default:** `4`. | |||
* `family` {number}: Version of IP stack. Must be `4`, `6`, or `0`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This may not be worth "fixing" as the fix may make the documentation more confusing while helping no one, but strictly speaking, if you pass a string value for family
, it will work too. So both the {number}
designation and the list of acceptable values are too narrow.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(If that is worth fixing, it probably should go in a different pull request as it might result in discussion that this change as-is probably won't. Might as well get this in and then "fix" the above either later or never.)
Landed in fd23c12 |
PR-URL: nodejs#28521 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
PR-URL: #28521 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Documentation says that default value is
4
, but in code no any default value:node/lib/net.js
Line 942 in d3b10f6
as result
dns.lookup
uses own default --0
.Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passes