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: check `autoSelectFamilyAttemptTimeout` is positive · nodejs/node@a1831da

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • lib
    • net.js
  • test/parallel
    • test-net-socket-connect-invalid-autoselectfamilyattempttimeout.js
Expand file treeCollapse file tree
Open diff view settings
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
@@ -1226,7 +1226,7 @@ function lookupAndConnect(self, options) {
12261226
}
12271227

12281228
if (autoSelectFamilyAttemptTimeout !== undefined) {
1229-
validateInt32(autoSelectFamilyAttemptTimeout);
1229+
validateInt32(autoSelectFamilyAttemptTimeout, 'options.autoSelectFamilyAttemptTimeout', 1);
12301230

12311231
if (autoSelectFamilyAttemptTimeout < 10) {
12321232
autoSelectFamilyAttemptTimeout = 10;
Collapse file

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

Copy file name to clipboard
+14Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
'use strict';
2+
require('../common');
3+
const assert = require('assert');
4+
const net = require('net');
5+
6+
for (const autoSelectFamilyAttemptTimeout of [-10, 0]) {
7+
assert.throws(() => {
8+
net.connect({
9+
port: 8080,
10+
autoSelectFamily: true,
11+
autoSelectFamilyAttemptTimeout,
12+
});
13+
}, { code: 'ERR_OUT_OF_RANGE' });
14+
}

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.