From 879b95efeaf433939df0d47e044cce7f7037dc59 Mon Sep 17 00:00:00 2001 From: Xavier Stouder Date: Mon, 29 Dec 2025 01:47:15 +0100 Subject: [PATCH] doc: correct options for net.Socket class and socket.connect MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit blockList, keepAlive, keepAliveInitialDelay and noDelay are wrongly documented for socket.connect options and missing on net.Socket constructor options documentation Fixes: https://github.com/nodejs/node/issues/59823 PR-URL: https://github.com/nodejs/node/pull/61179 Reviewed-By: Antoine du Hamel Reviewed-By: Colin Ihrig Reviewed-By: Luigi Pinca Reviewed-By: Juan José Arboleda --- doc/api/net.md | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/doc/api/net.md b/doc/api/net.md index e258b331b3..7d8b863bdf 100644 --- a/doc/api/net.md +++ b/doc/api/net.md @@ -759,8 +759,17 @@ changes: automatically end the writable side when the readable side ends. See [`net.createServer()`][] and the [`'end'`][] event for details. **Default:** `false`. + * `blockList` {net.BlockList} `blockList` can be used for disabling outbound + access to specific IP addresses, IP ranges, or IP subnets. * `fd` {number} If specified, wrap around an existing socket with the given file descriptor, otherwise a new socket will be created. + * `keepAlive` {boolean} If set to `true`, it enables keep-alive functionality on + the socket immediately after the connection is established, similarly on what + is done in [`socket.setKeepAlive()`][]. **Default:** `false`. + * `keepAliveInitialDelay` {number} If set to a positive number, it sets the + initial delay before the first keepalive probe is sent on an idle socket. **Default:** `0`. + * `noDelay` {boolean} If set to `true`, it disables the use of Nagle's algorithm + immediately after the socket is established. **Default:** `false`. * `onread` {Object} If specified, incoming data is stored in a single `buffer` and passed to the supplied `callback` when data arrives on the socket. This will cause the streaming functionality to not provide any data. @@ -1123,20 +1132,10 @@ For TCP connections, available `options` are: `0` indicates that both IPv4 and IPv6 addresses are allowed. **Default:** `0`. * `hints` {number} Optional [`dns.lookup()` hints][]. * `host` {string} Host the socket should connect to. **Default:** `'localhost'`. -* `keepAlive` {boolean} If set to `true`, it enables keep-alive functionality on - the socket immediately after the connection is established, similarly on what - is done in [`socket.setKeepAlive()`][]. **Default:** `false`. -* `keepAliveInitialDelay` {number} If set to a positive number, it sets the - initial delay before the first keepalive probe is sent on an idle socket. - **Default:** `0`. * `localAddress` {string} Local address the socket should connect from. * `localPort` {number} Local port the socket should connect from. * `lookup` {Function} Custom lookup function. **Default:** [`dns.lookup()`][]. -* `noDelay` {boolean} If set to `true`, it disables the use of Nagle's algorithm - immediately after the socket is established. **Default:** `false`. * `port` {number} Required. Port the socket should connect to. -* `blockList` {net.BlockList} `blockList` can be used for disabling outbound - access to specific IP addresses, IP ranges, or IP subnets. For [IPC][] connections, available `options` are: