Skip to content

Commit 14afb39

Browse files
ArnoldZokastargos
authored andcommitted
doc: document new TCP_KEEPCNT and TCP_KEEPINTVL socket option defaults
PR #32204 introduced new defaults for the TCP keep-alive socket options (see deps/uv/src/unix/tcp.c): - "TCP_KEEPCNT" now defaults to 10 on all platforms - "TCP_KEEPINTVL" now defaults to 1 on all platforms Previously, "TCP_KEEPCNT" and "TCP_KEEPINTVL" were not set explicitly and OS-default values were used. Fixes: #38298 Refs: #32204 PR-URL: #38313 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Rich Trott <[email protected]>
1 parent ed5ef21 commit 14afb39

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

doc/api/net.md

+12
Original file line numberDiff line numberDiff line change
@@ -1007,6 +1007,12 @@ Set the encoding for the socket as a [Readable Stream][]. See
10071007
### `socket.setKeepAlive([enable][, initialDelay])`
10081008
<!-- YAML
10091009
added: v0.1.92
1010+
changes:
1011+
- version:
1012+
- v13.12.0
1013+
- v12.17.0
1014+
pr-url: https://github.com/nodejs/node/pull/32204
1015+
description: New defaults for `TCP_KEEPCNT` and `TCP_KEEPINTVL` socket options were added.
10101016
-->
10111017

10121018
* `enable` {boolean} **Default:** `false`
@@ -1021,6 +1027,12 @@ data packet received and the first keepalive probe. Setting `0` for
10211027
`initialDelay` will leave the value unchanged from the default
10221028
(or previous) setting.
10231029

1030+
Enabling the keep-alive functionality will set the following socket options:
1031+
* `SO_KEEPALIVE=1`
1032+
* `TCP_KEEPIDLE=initialDelay`
1033+
* `TCP_KEEPCNT=10`
1034+
* `TCP_KEEPINTVL=1`
1035+
10241036
### `socket.setNoDelay([noDelay])`
10251037
<!-- YAML
10261038
added: v0.1.90

0 commit comments

Comments
 (0)