Skip to content
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

Closed

Conversation

fanatid
Copy link
Contributor

@fanatid fanatid commented Jul 3, 2019

Documentation says that default value is 4, but in code no any default value:

node/lib/net.js

Line 942 in d3b10f6

family: options.family,

as result dns.lookup uses own default -- 0.

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • documentation is changed or added
  • commit message follows commit guidelines

@nodejs-github-bot nodejs-github-bot added doc Issues and PRs related to the documentations. net Issues and PRs related to the net subsystem. labels Jul 3, 2019
@@ -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`.
Copy link
Member

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.

Copy link
Member

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.)

@Trott
Copy link
Member

Trott commented Jul 3, 2019

@Trott Trott added the author ready PRs that have at least one approval, no pending requests for changes, and a CI started. label Jul 3, 2019
@Trott
Copy link
Member

Trott commented Jul 6, 2019

Landed in fd23c12

@Trott Trott closed this Jul 6, 2019
Trott pushed a commit to Trott/io.js that referenced this pull request Jul 6, 2019
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>
@fanatid fanatid deleted the fix/doc-net-socket-connect-family branch July 6, 2019 05:36
targos pushed a commit that referenced this pull request Jul 20, 2019
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>
This was referenced Jul 23, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
author ready PRs that have at least one approval, no pending requests for changes, and a CI started. doc Issues and PRs related to the documentations. net Issues and PRs related to the net subsystem.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants