@@ -474,21 +474,22 @@ changes:
474
474
-->
475
475
476
476
* ` 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] [ ] .
481
477
* ` backlog ` {number} Common parameter of [ ` server.listen() ` ] [ ]
482
478
functions.
483
479
* ` 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}
484
487
* ` readableAll ` {boolean} For IPC servers makes the pipe readable
485
488
for all users. ** Default:** ` false ` .
489
+ * ` signal ` {AbortSignal} An AbortSignal that may be used to close a listening
490
+ server.
486
491
* ` writableAll ` {boolean} For IPC servers makes the pipe writable
487
492
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.
492
493
* ` callback ` {Function}
493
494
functions.
494
495
* Returns: {net.Server}
@@ -653,18 +654,18 @@ changes:
653
654
-->
654
655
655
656
* ` 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.
658
657
* ` allowHalfOpen ` {boolean} If set to ` false ` , then the socket will
659
658
automatically end the writable side when the readable side ends. See
660
659
[ ` net.createServer() ` ] [ ] and the [ ` 'end' ` ] [ ] event for details. ** Default:**
661
660
` false ` .
661
+ * ` fd ` {number} If specified, wrap around an existing socket with
662
+ the given file descriptor, otherwise a new socket will be created.
662
663
* ` readable ` {boolean} Allow reads on the socket when an ` fd ` is passed,
663
664
otherwise ignored. ** Default:** ` false ` .
664
- * ` writable ` {boolean} Allow writes on the socket when an ` fd ` is passed,
665
- otherwise ignored. ** Default:** ` false ` .
666
665
* ` signal ` {AbortSignal} An Abort signal that may be used to destroy the
667
666
socket.
667
+ * ` writable ` {boolean} Allow writes on the socket when an ` fd ` is passed,
668
+ otherwise ignored. ** Default:** ` false ` .
668
669
* Returns: {net.Socket}
669
670
670
671
Creates a new socket object.
@@ -979,37 +980,40 @@ this only when implementing a custom Socket.
979
980
980
981
For TCP connections, available ` options ` are:
981
982
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() ` ] [ ] .
986
1001
* ` family ` {number}: Version of IP stack. Must be ` 4 ` , ` 6 ` , or ` 0 ` . The value
987
1002
` 0 ` indicates that both IPv4 and IPv6 addresses are allowed. ** Default:** ` 0 ` .
988
1003
* ` 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.
989
1013
* ` 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.
1013
1017
1014
1018
For [ IPC] [ ] connections, available ` options ` are:
1015
1019
@@ -1621,16 +1625,18 @@ changes:
1621
1625
* ` highWaterMark ` {number} Optionally overrides all [ ` net.Socket ` ] [ ] s'
1622
1626
` readableHighWaterMark ` and ` writableHighWaterMark ` .
1623
1627
** 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 ` .
1624
1638
* ` pauseOnConnect ` {boolean} Indicates whether the socket should be
1625
1639
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 ` .
1634
1640
1635
1641
* ` connectionListener ` {Function} Automatically set as a listener for the
1636
1642
[ ` 'connection' ` ] [ ] event.
@@ -1849,7 +1855,7 @@ net.isIPv6('fhqwhgads'); // returns false
1849
1855
[ `socket.pause()` ] : #socketpause
1850
1856
[ `socket.resume()` ] : #socketresume
1851
1857
[ `socket.setEncoding()` ] : #socketsetencodingencoding
1852
- [ `socket.setKeepAlive(enable, initialDelay )` ] : #socketsetkeepaliveenable-initialdelay
1858
+ [ `socket.setKeepAlive()` ] : #socketsetkeepaliveenable-initialdelay
1853
1859
[ `socket.setTimeout()` ] : #socketsettimeouttimeout-callback
1854
1860
[ `socket.setTimeout(timeout)` ] : #socketsettimeouttimeout-callback
1855
1861
[ `stream.getDefaultHighWaterMark()` ] : stream.md#streamgetdefaulthighwatermarkobjectmode
0 commit comments