@@ -474,21 +474,22 @@ changes:
474474-->
475475
476476* ` options ` {Object} Required. Supports the following properties:
477- * ` port ` {number}
478- * ` host ` {string}
479- * ` path ` {string} Will be ignored if ` port ` is specified. See
480- [ Identifying paths for IPC connections] [ ] .
481477 * ` backlog ` {number} Common parameter of [ ` server.listen() ` ] [ ]
482478 functions.
483479 * ` exclusive ` {boolean} ** Default:** ` false `
480+ * ` host ` {string}
481+ * ` ipv6Only ` {boolean} For TCP servers, setting ` ipv6Only ` to ` true ` will
482+ disable dual-stack support, i.e., binding to host ` :: ` won't make
483+ ` 0.0.0.0 ` be bound. ** Default:** ` false ` .
484+ * ` path ` {string} Will be ignored if ` port ` is specified. See
485+ [ Identifying paths for IPC connections] [ ] .
486+ * ` port ` {number}
484487 * ` readableAll ` {boolean} For IPC servers makes the pipe readable
485488 for all users. ** Default:** ` false ` .
489+ * ` signal ` {AbortSignal} An AbortSignal that may be used to close a listening
490+ server.
486491 * ` writableAll ` {boolean} For IPC servers makes the pipe writable
487492 for all users. ** Default:** ` false ` .
488- * ` ipv6Only ` {boolean} For TCP servers, setting ` ipv6Only ` to ` true ` will
489- disable dual-stack support, i.e., binding to host ` :: ` won't make
490- ` 0.0.0.0 ` be bound. ** Default:** ` false ` .
491- * ` signal ` {AbortSignal} An AbortSignal that may be used to close a listening server.
492493* ` callback ` {Function}
493494 functions.
494495* Returns: {net.Server}
@@ -653,18 +654,18 @@ changes:
653654-->
654655
655656* ` options ` {Object} Available options are:
656- * ` fd ` {number} If specified, wrap around an existing socket with
657- the given file descriptor, otherwise a new socket will be created.
658657 * ` allowHalfOpen ` {boolean} If set to ` false ` , then the socket will
659658 automatically end the writable side when the readable side ends. See
660659 [ ` net.createServer() ` ] [ ] and the [ ` 'end' ` ] [ ] event for details. ** Default:**
661660 ` false ` .
661+ * ` fd ` {number} If specified, wrap around an existing socket with
662+ the given file descriptor, otherwise a new socket will be created.
662663 * ` readable ` {boolean} Allow reads on the socket when an ` fd ` is passed,
663664 otherwise ignored. ** Default:** ` false ` .
664- * ` writable ` {boolean} Allow writes on the socket when an ` fd ` is passed,
665- otherwise ignored. ** Default:** ` false ` .
666665 * ` signal ` {AbortSignal} An Abort signal that may be used to destroy the
667666 socket.
667+ * ` writable ` {boolean} Allow writes on the socket when an ` fd ` is passed,
668+ otherwise ignored. ** Default:** ` false ` .
668669* Returns: {net.Socket}
669670
670671Creates a new socket object.
@@ -979,37 +980,40 @@ this only when implementing a custom Socket.
979980
980981For TCP connections, available ` options ` are:
981982
982- * ` port ` {number} Required. Port the socket should connect to.
983- * ` host ` {string} Host the socket should connect to. ** Default:** ` 'localhost' ` .
984- * ` localAddress ` {string} Local address the socket should connect from.
985- * ` localPort ` {number} Local port the socket should connect from.
983+ * ` autoSelectFamily ` {boolean}: If set to ` true ` , it enables a family
984+ autodetection algorithm that loosely implements section 5 of [ RFC 8305] [ ] . The
985+ ` all ` option passed to lookup is set to ` true ` and the sockets attempts to
986+ connect to all obtained IPv6 and IPv4 addresses, in sequence, until a
987+ connection is established. The first returned AAAA address is tried first,
988+ then the first returned A address, then the second returned AAAA address and
989+ so on. Each connection attempt (but the last one) is given the amount of time
990+ specified by the ` autoSelectFamilyAttemptTimeout ` option before timing out and
991+ trying the next address. Ignored if the ` family ` option is not ` 0 ` or if
992+ ` localAddress ` is set. Connection errors are not emitted if at least one
993+ connection succeeds. If all connections attempts fails, a single
994+ ` AggregateError ` with all failed attempts is emitted. ** Default:**
995+ [ ` net.getDefaultAutoSelectFamily() ` ] [ ] .
996+ * ` autoSelectFamilyAttemptTimeout ` {number}: The amount of time in milliseconds
997+ to wait for a connection attempt to finish before trying the next address when
998+ using the ` autoSelectFamily ` option. If set to a positive integer less than
999+ ` 10 ` , then the value ` 10 ` will be used instead. ** Default:**
1000+ [ ` net.getDefaultAutoSelectFamilyAttemptTimeout() ` ] [ ] .
9861001* ` family ` {number}: Version of IP stack. Must be ` 4 ` , ` 6 ` , or ` 0 ` . The value
9871002 ` 0 ` indicates that both IPv4 and IPv6 addresses are allowed. ** Default:** ` 0 ` .
9881003* ` hints ` {number} Optional [ ` dns.lookup() ` hints] [ ] .
1004+ * ` host ` {string} Host the socket should connect to. ** Default:** ` 'localhost' ` .
1005+ * ` keepAlive ` {boolean} If set to ` true ` , it enables keep-alive functionality on
1006+ the socket immediately after the connection is established, similarly on what
1007+ is done in [ ` socket.setKeepAlive() ` ] [ ] . ** Default:** ` false ` .
1008+ * ` keepAliveInitialDelay ` {number} If set to a positive number, it sets the
1009+ initial delay before the first keepalive probe is sent on an idle socket.
1010+ ** Default:** ` 0 ` .
1011+ * ` localAddress ` {string} Local address the socket should connect from.
1012+ * ` localPort ` {number} Local port the socket should connect from.
9891013* ` lookup ` {Function} Custom lookup function. ** Default:** [ ` dns.lookup() ` ] [ ] .
990- * ` noDelay ` {boolean} If set to ` true ` , it disables the use of Nagle's algorithm immediately
991- after the socket is established. ** Default:** ` false ` .
992- * ` keepAlive ` {boolean} If set to ` true ` , it enables keep-alive functionality on the socket
993- immediately after the connection is established, similarly on what is done in
994- [ ` socket.setKeepAlive([enable][, initialDelay]) ` ] [ `socket.setKeepAlive(enable, initialDelay)` ] .
995- ** Default:** ` false ` .
996- * ` keepAliveInitialDelay ` {number} If set to a positive number, it sets the initial delay before
997- the first keepalive probe is sent on an idle socket.** Default:** ` 0 ` .
998- * ` autoSelectFamily ` {boolean}: If set to ` true ` , it enables a family autodetection algorithm
999- that loosely implements section 5 of [ RFC 8305] [ ] .
1000- The ` all ` option passed to lookup is set to ` true ` and the sockets attempts to connect to all
1001- obtained IPv6 and IPv4 addresses, in sequence, until a connection is established.
1002- The first returned AAAA address is tried first, then the first returned A address,
1003- then the second returned AAAA address and so on.
1004- Each connection attempt (but the last one) is given the amount of time specified by the ` autoSelectFamilyAttemptTimeout ` option before timing out and trying the next address.
1005- Ignored if the ` family ` option is not ` 0 ` or if ` localAddress ` is set.
1006- Connection errors are not emitted if at least one connection succeeds.
1007- If all connections attempts fails, a single ` AggregateError ` with all failed attempts is emitted.
1008- ** Default:** [ ` net.getDefaultAutoSelectFamily() ` ] [ ]
1009- * ` autoSelectFamilyAttemptTimeout ` {number}: The amount of time in milliseconds to wait
1010- for a connection attempt to finish before trying the next address when using the ` autoSelectFamily ` option.
1011- If set to a positive integer less than ` 10 ` , then the value ` 10 ` will be used instead.
1012- ** Default:** [ ` net.getDefaultAutoSelectFamilyAttemptTimeout() ` ] [ ]
1014+ * ` noDelay ` {boolean} If set to ` true ` , it disables the use of Nagle's algorithm
1015+ immediately after the socket is established. ** Default:** ` false ` .
1016+ * ` port ` {number} Required. Port the socket should connect to.
10131017
10141018For [ IPC] [ ] connections, available ` options ` are:
10151019
@@ -1621,16 +1625,18 @@ changes:
16211625 * ` highWaterMark ` {number} Optionally overrides all [ ` net.Socket ` ] [ ] s'
16221626 ` readableHighWaterMark ` and ` writableHighWaterMark ` .
16231627 ** Default:** See [ ` stream.getDefaultHighWaterMark() ` ] [ ] .
1628+ * ` keepAlive ` {boolean} If set to ` true ` , it enables keep-alive functionality
1629+ on the socket immediately after a new incoming connection is received,
1630+ similarly on what is done in [ ` socket.setKeepAlive() ` ] [ ] . ** Default:**
1631+ ` false ` .
1632+ * ` keepAliveInitialDelay ` {number} If set to a positive number, it sets the
1633+ initial delay before the first keepalive probe is sent on an idle socket.
1634+ ** Default:** ` 0 ` .
1635+ * ` noDelay ` {boolean} If set to ` true ` , it disables the use of Nagle's
1636+ algorithm immediately after a new incoming connection is received.
1637+ ** Default:** ` false ` .
16241638 * ` pauseOnConnect ` {boolean} Indicates whether the socket should be
16251639 paused on incoming connections. ** Default:** ` false ` .
1626- * ` noDelay ` {boolean} If set to ` true ` , it disables the use of Nagle's algorithm immediately
1627- after a new incoming connection is received. ** Default:** ` false ` .
1628- * ` keepAlive ` {boolean} If set to ` true ` , it enables keep-alive functionality on the socket
1629- immediately after a new incoming connection is received, similarly on what is done in
1630- [ ` socket.setKeepAlive([enable][, initialDelay]) ` ] [ `socket.setKeepAlive(enable, initialDelay)` ] .
1631- ** Default:** ` false ` .
1632- * ` keepAliveInitialDelay ` {number} If set to a positive number, it sets the initial delay before
1633- the first keepalive probe is sent on an idle socket.** Default:** ` 0 ` .
16341640
16351641* ` connectionListener ` {Function} Automatically set as a listener for the
16361642 [ ` 'connection' ` ] [ ] event.
@@ -1849,7 +1855,7 @@ net.isIPv6('fhqwhgads'); // returns false
18491855[ `socket.pause()` ] : #socketpause
18501856[ `socket.resume()` ] : #socketresume
18511857[ `socket.setEncoding()` ] : #socketsetencodingencoding
1852- [ `socket.setKeepAlive(enable, initialDelay )` ] : #socketsetkeepaliveenable-initialdelay
1858+ [ `socket.setKeepAlive()` ] : #socketsetkeepaliveenable-initialdelay
18531859[ `socket.setTimeout()` ] : #socketsettimeouttimeout-callback
18541860[ `socket.setTimeout(timeout)` ] : #socketsettimeouttimeout-callback
18551861[ `stream.getDefaultHighWaterMark()` ] : stream.md#streamgetdefaulthighwatermarkobjectmode
0 commit comments