Skip to content

Commit 879b95e

Browse files
authored
doc: correct options for net.Socket class and socket.connect
blockList, keepAlive, keepAliveInitialDelay and noDelay are wrongly documented for socket.connect options and missing on net.Socket constructor options documentation Fixes: #59823 PR-URL: #61179 Reviewed-By: Antoine du Hamel <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Juan José Arboleda <[email protected]>
1 parent 05d6b9b commit 879b95e

File tree

1 file changed

+9
-10
lines changed

1 file changed

+9
-10
lines changed

doc/api/net.md

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -759,8 +759,17 @@ changes:
759759
automatically end the writable side when the readable side ends. See
760760
[`net.createServer()`][] and the [`'end'`][] event for details. **Default:**
761761
`false`.
762+
* `blockList` {net.BlockList} `blockList` can be used for disabling outbound
763+
access to specific IP addresses, IP ranges, or IP subnets.
762764
* `fd` {number} If specified, wrap around an existing socket with
763765
the given file descriptor, otherwise a new socket will be created.
766+
* `keepAlive` {boolean} If set to `true`, it enables keep-alive functionality on
767+
the socket immediately after the connection is established, similarly on what
768+
is done in [`socket.setKeepAlive()`][]. **Default:** `false`.
769+
* `keepAliveInitialDelay` {number} If set to a positive number, it sets the
770+
initial delay before the first keepalive probe is sent on an idle socket. **Default:** `0`.
771+
* `noDelay` {boolean} If set to `true`, it disables the use of Nagle's algorithm
772+
immediately after the socket is established. **Default:** `false`.
764773
* `onread` {Object} If specified, incoming data is stored in a single `buffer`
765774
and passed to the supplied `callback` when data arrives on the socket.
766775
This will cause the streaming functionality to not provide any data.
@@ -1123,20 +1132,10 @@ For TCP connections, available `options` are:
11231132
`0` indicates that both IPv4 and IPv6 addresses are allowed. **Default:** `0`.
11241133
* `hints` {number} Optional [`dns.lookup()` hints][].
11251134
* `host` {string} Host the socket should connect to. **Default:** `'localhost'`.
1126-
* `keepAlive` {boolean} If set to `true`, it enables keep-alive functionality on
1127-
the socket immediately after the connection is established, similarly on what
1128-
is done in [`socket.setKeepAlive()`][]. **Default:** `false`.
1129-
* `keepAliveInitialDelay` {number} If set to a positive number, it sets the
1130-
initial delay before the first keepalive probe is sent on an idle socket.
1131-
**Default:** `0`.
11321135
* `localAddress` {string} Local address the socket should connect from.
11331136
* `localPort` {number} Local port the socket should connect from.
11341137
* `lookup` {Function} Custom lookup function. **Default:** [`dns.lookup()`][].
1135-
* `noDelay` {boolean} If set to `true`, it disables the use of Nagle's algorithm
1136-
immediately after the socket is established. **Default:** `false`.
11371138
* `port` {number} Required. Port the socket should connect to.
1138-
* `blockList` {net.BlockList} `blockList` can be used for disabling outbound
1139-
access to specific IP addresses, IP ranges, or IP subnets.
11401139

11411140
For [IPC][] connections, available `options` are:
11421141

0 commit comments

Comments
 (0)