GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — net: fix setting of value in 'setDefaultAutoSelectFamilyAttemptTimeout' · nodejs/node@67fe7d8

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • doc/api
    • net.md
  • lib
    • net.js
  • test/parallel
    • test-net-socket-connect-invalid-autoselectfamilyattempttimeout.js
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎doc/api/net.md‎

Copy file name to clipboardExpand all lines: doc/api/net.md
+1-1Lines changed: 1 addition & 1 deletion
  • Display the source diff
  • Display the rich diff
Original file line numberDiff line numberDiff line change
@@ -1670,7 +1670,7 @@ added: v18.18.0
16701670
Sets the default value of the `autoSelectFamilyAttemptTimeout` option of [`socket.connect(options)`][].
16711671

16721672
* `value` {number} The new default value, which must be a positive number. If the number is less than `10`,
1673-
the value `10` is used insted The initial default value is `250`.
1673+
the value `10` is used instead. The initial default value is `250`.
16741674

16751675
## `net.isIP(input)`
16761676

Collapse file

‎lib/net.js‎

Copy file name to clipboardExpand all lines: lib/net.js
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,7 @@ function getDefaultAutoSelectFamilyAttemptTimeout() {
265265
function setDefaultAutoSelectFamilyAttemptTimeout(value) {
266266
validateInt32(value, 'value', 1);
267267

268-
if (value < 1) {
268+
if (value < 10) {
269269
value = 10;
270270
}
271271

Collapse file

‎test/parallel/test-net-socket-connect-invalid-autoselectfamilyattempttimeout.js‎

Copy file name to clipboardExpand all lines: test/parallel/test-net-socket-connect-invalid-autoselectfamilyattempttimeout.js
+7Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,3 +18,10 @@ for (const autoSelectFamilyAttemptTimeout of [-10, 0]) {
1818
net.setDefaultAutoSelectFamilyAttemptTimeout(autoSelectFamilyAttemptTimeout);
1919
}, { code: 'ERR_OUT_OF_RANGE' });
2020
}
21+
22+
// Check the default value of autoSelectFamilyAttemptTimeout is 10
23+
// if passed number is less than 10
24+
for (const autoSelectFamilyAttemptTimeout of [1, 9]) {
25+
net.setDefaultAutoSelectFamilyAttemptTimeout(autoSelectFamilyAttemptTimeout);
26+
assert.strictEqual(net.getDefaultAutoSelectFamilyAttemptTimeout(), 10);
27+
}

0 commit comments

Comments
0 (0)
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.