@@ -476,21 +476,22 @@ changes:
476
476
-->
477
477
478
478
* ` options ` {Object} Required. Supports the following properties:
479
- * ` port ` {number}
480
- * ` host ` {string}
481
- * ` path ` {string} Will be ignored if ` port ` is specified. See
482
- [ Identifying paths for IPC connections] [ ] .
483
479
* ` backlog ` {number} Common parameter of [ ` server.listen() ` ] [ ]
484
480
functions.
485
481
* ` exclusive ` {boolean} ** Default:** ` false `
482
+ * ` host ` {string}
483
+ * ` ipv6Only ` {boolean} For TCP servers, setting ` ipv6Only ` to ` true ` will
484
+ disable dual-stack support, i.e., binding to host ` :: ` won't make
485
+ ` 0.0.0.0 ` be bound. ** Default:** ` false ` .
486
+ * ` path ` {string} Will be ignored if ` port ` is specified. See
487
+ [ Identifying paths for IPC connections] [ ] .
488
+ * ` port ` {number}
486
489
* ` readableAll ` {boolean} For IPC servers makes the pipe readable
487
490
for all users. ** Default:** ` false ` .
491
+ * ` signal ` {AbortSignal} An AbortSignal that may be used to close a listening
492
+ server.
488
493
* ` writableAll ` {boolean} For IPC servers makes the pipe writable
489
494
for all users. ** Default:** ` false ` .
490
- * ` ipv6Only ` {boolean} For TCP servers, setting ` ipv6Only ` to ` true ` will
491
- disable dual-stack support, i.e., binding to host ` :: ` won't make
492
- ` 0.0.0.0 ` be bound. ** Default:** ` false ` .
493
- * ` signal ` {AbortSignal} An AbortSignal that may be used to close a listening server.
494
495
* ` callback ` {Function}
495
496
functions.
496
497
* Returns: {net.Server}
@@ -660,18 +661,18 @@ changes:
660
661
-->
661
662
662
663
* ` options ` {Object} Available options are:
663
- * ` fd ` {number} If specified, wrap around an existing socket with
664
- the given file descriptor, otherwise a new socket will be created.
665
664
* ` allowHalfOpen ` {boolean} If set to ` false ` , then the socket will
666
665
automatically end the writable side when the readable side ends. See
667
666
[ ` net.createServer() ` ] [ ] and the [ ` 'end' ` ] [ ] event for details. ** Default:**
668
667
` false ` .
668
+ * ` fd ` {number} If specified, wrap around an existing socket with
669
+ the given file descriptor, otherwise a new socket will be created.
669
670
* ` readable ` {boolean} Allow reads on the socket when an ` fd ` is passed,
670
671
otherwise ignored. ** Default:** ` false ` .
671
- * ` writable ` {boolean} Allow writes on the socket when an ` fd ` is passed,
672
- otherwise ignored. ** Default:** ` false ` .
673
672
* ` signal ` {AbortSignal} An Abort signal that may be used to destroy the
674
673
socket.
674
+ * ` writable ` {boolean} Allow writes on the socket when an ` fd ` is passed,
675
+ otherwise ignored. ** Default:** ` false ` .
675
676
* Returns: {net.Socket}
676
677
677
678
Creates a new socket object.
@@ -996,37 +997,40 @@ this only when implementing a custom Socket.
996
997
997
998
For TCP connections, available ` options ` are:
998
999
999
- * ` port ` {number} Required. Port the socket should connect to.
1000
- * ` host ` {string} Host the socket should connect to. ** Default:** ` 'localhost' ` .
1001
- * ` localAddress ` {string} Local address the socket should connect from.
1002
- * ` localPort ` {number} Local port the socket should connect from.
1000
+ * ` autoSelectFamily ` {boolean}: If set to ` true ` , it enables a family
1001
+ autodetection algorithm that loosely implements section 5 of [ RFC 8305] [ ] . The
1002
+ ` all ` option passed to lookup is set to ` true ` and the sockets attempts to
1003
+ connect to all obtained IPv6 and IPv4 addresses, in sequence, until a
1004
+ connection is established. The first returned AAAA address is tried first,
1005
+ then the first returned A address, then the second returned AAAA address and
1006
+ so on. Each connection attempt (but the last one) is given the amount of time
1007
+ specified by the ` autoSelectFamilyAttemptTimeout ` option before timing out and
1008
+ trying the next address. Ignored if the ` family ` option is not ` 0 ` or if
1009
+ ` localAddress ` is set. Connection errors are not emitted if at least one
1010
+ connection succeeds. If all connections attempts fails, a single
1011
+ ` AggregateError ` with all failed attempts is emitted. ** Default:**
1012
+ [ ` net.getDefaultAutoSelectFamily() ` ] [ ] .
1013
+ * ` autoSelectFamilyAttemptTimeout ` {number}: The amount of time in milliseconds
1014
+ to wait for a connection attempt to finish before trying the next address when
1015
+ using the ` autoSelectFamily ` option. If set to a positive integer less than
1016
+ ` 10 ` , then the value ` 10 ` will be used instead. ** Default:**
1017
+ [ ` net.getDefaultAutoSelectFamilyAttemptTimeout() ` ] [ ] .
1003
1018
* ` family ` {number}: Version of IP stack. Must be ` 4 ` , ` 6 ` , or ` 0 ` . The value
1004
1019
` 0 ` indicates that both IPv4 and IPv6 addresses are allowed. ** Default:** ` 0 ` .
1005
1020
* ` hints ` {number} Optional [ ` dns.lookup() ` hints] [ ] .
1021
+ * ` host ` {string} Host the socket should connect to. ** Default:** ` 'localhost' ` .
1022
+ * ` keepAlive ` {boolean} If set to ` true ` , it enables keep-alive functionality on
1023
+ the socket immediately after the connection is established, similarly on what
1024
+ is done in [ ` socket.setKeepAlive() ` ] [ ] . ** Default:** ` false ` .
1025
+ * ` keepAliveInitialDelay ` {number} If set to a positive number, it sets the
1026
+ initial delay before the first keepalive probe is sent on an idle socket.
1027
+ ** Default:** ` 0 ` .
1028
+ * ` localAddress ` {string} Local address the socket should connect from.
1029
+ * ` localPort ` {number} Local port the socket should connect from.
1006
1030
* ` lookup ` {Function} Custom lookup function. ** Default:** [ ` dns.lookup() ` ] [ ] .
1007
- * ` noDelay ` {boolean} If set to ` true ` , it disables the use of Nagle's algorithm immediately
1008
- after the socket is established. ** Default:** ` false ` .
1009
- * ` keepAlive ` {boolean} If set to ` true ` , it enables keep-alive functionality on the socket
1010
- immediately after the connection is established, similarly on what is done in
1011
- [ ` socket.setKeepAlive([enable][, initialDelay]) ` ] [ `socket.setKeepAlive(enable, initialDelay)` ] .
1012
- ** Default:** ` false ` .
1013
- * ` keepAliveInitialDelay ` {number} If set to a positive number, it sets the initial delay before
1014
- the first keepalive probe is sent on an idle socket.** Default:** ` 0 ` .
1015
- * ` autoSelectFamily ` {boolean}: If set to ` true ` , it enables a family autodetection algorithm
1016
- that loosely implements section 5 of [ RFC 8305] [ ] .
1017
- The ` all ` option passed to lookup is set to ` true ` and the sockets attempts to connect to all
1018
- obtained IPv6 and IPv4 addresses, in sequence, until a connection is established.
1019
- The first returned AAAA address is tried first, then the first returned A address,
1020
- then the second returned AAAA address and so on.
1021
- 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.
1022
- Ignored if the ` family ` option is not ` 0 ` or if ` localAddress ` is set.
1023
- Connection errors are not emitted if at least one connection succeeds.
1024
- If all connections attempts fails, a single ` AggregateError ` with all failed attempts is emitted.
1025
- ** Default:** [ ` net.getDefaultAutoSelectFamily() ` ] [ ]
1026
- * ` autoSelectFamilyAttemptTimeout ` {number}: The amount of time in milliseconds to wait
1027
- for a connection attempt to finish before trying the next address when using the ` autoSelectFamily ` option.
1028
- If set to a positive integer less than ` 10 ` , then the value ` 10 ` will be used instead.
1029
- ** Default:** [ ` net.getDefaultAutoSelectFamilyAttemptTimeout() ` ] [ ]
1031
+ * ` noDelay ` {boolean} If set to ` true ` , it disables the use of Nagle's algorithm
1032
+ immediately after the socket is established. ** Default:** ` false ` .
1033
+ * ` port ` {number} Required. Port the socket should connect to.
1030
1034
1031
1035
For [ IPC] [ ] connections, available ` options ` are:
1032
1036
@@ -1640,16 +1644,18 @@ changes:
1640
1644
* ` highWaterMark ` {number} Optionally overrides all [ ` net.Socket ` ] [ ] s'
1641
1645
` readableHighWaterMark ` and ` writableHighWaterMark ` .
1642
1646
** Default:** See [ ` stream.getDefaultHighWaterMark() ` ] [ ] .
1647
+ * ` keepAlive ` {boolean} If set to ` true ` , it enables keep-alive functionality
1648
+ on the socket immediately after a new incoming connection is received,
1649
+ similarly on what is done in [ ` socket.setKeepAlive() ` ] [ ] . ** Default:**
1650
+ ` false ` .
1651
+ * ` keepAliveInitialDelay ` {number} If set to a positive number, it sets the
1652
+ initial delay before the first keepalive probe is sent on an idle socket.
1653
+ ** Default:** ` 0 ` .
1654
+ * ` noDelay ` {boolean} If set to ` true ` , it disables the use of Nagle's
1655
+ algorithm immediately after a new incoming connection is received.
1656
+ ** Default:** ` false ` .
1643
1657
* ` pauseOnConnect ` {boolean} Indicates whether the socket should be
1644
1658
paused on incoming connections. ** Default:** ` false ` .
1645
- * ` noDelay ` {boolean} If set to ` true ` , it disables the use of Nagle's algorithm immediately
1646
- after a new incoming connection is received. ** Default:** ` false ` .
1647
- * ` keepAlive ` {boolean} If set to ` true ` , it enables keep-alive functionality on the socket
1648
- immediately after a new incoming connection is received, similarly on what is done in
1649
- [ ` socket.setKeepAlive([enable][, initialDelay]) ` ] [ `socket.setKeepAlive(enable, initialDelay)` ] .
1650
- ** Default:** ` false ` .
1651
- * ` keepAliveInitialDelay ` {number} If set to a positive number, it sets the initial delay before
1652
- the first keepalive probe is sent on an idle socket.** Default:** ` 0 ` .
1653
1659
1654
1660
* ` connectionListener ` {Function} Automatically set as a listener for the
1655
1661
[ ` 'connection' ` ] [ ] event.
@@ -1872,7 +1878,7 @@ net.isIPv6('fhqwhgads'); // returns false
1872
1878
[ `socket.pause()` ] : #socketpause
1873
1879
[ `socket.resume()` ] : #socketresume
1874
1880
[ `socket.setEncoding()` ] : #socketsetencodingencoding
1875
- [ `socket.setKeepAlive(enable, initialDelay )` ] : #socketsetkeepaliveenable-initialdelay
1881
+ [ `socket.setKeepAlive()` ] : #socketsetkeepaliveenable-initialdelay
1876
1882
[ `socket.setTimeout()` ] : #socketsettimeouttimeout-callback
1877
1883
[ `socket.setTimeout(timeout)` ] : #socketsettimeouttimeout-callback
1878
1884
[ `stream.getDefaultHighWaterMark()` ] : stream.md#streamgetdefaulthighwatermarkobjectmode
0 commit comments