Skip to content

Commit ba117c2

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 <jasnell@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com>
1 parent dcdbaff commit ba117c2

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
@@ -873,6 +873,12 @@ Set the encoding for the socket as a [Readable Stream][]. See
873873
### `socket.setKeepAlive([enable][, initialDelay])`
874874
<!-- YAML
875875
added: v0.1.92
876+
changes:
877+
- version:
878+
- v13.12.0
879+
- v12.17.0
880+
pr-url: https://github.com/nodejs/node/pull/32204
881+
description: New defaults for `TCP_KEEPCNT` and `TCP_KEEPINTVL` socket options were added.
876882
-->
877883

878884
* `enable` {boolean} **Default:** `false`
@@ -887,6 +893,12 @@ data packet received and the first keepalive probe. Setting `0` for
887893
`initialDelay` will leave the value unchanged from the default
888894
(or previous) setting.
889895

896+
Enabling the keep-alive functionality will set the following socket options:
897+
* `SO_KEEPALIVE=1`
898+
* `TCP_KEEPIDLE=initialDelay`
899+
* `TCP_KEEPCNT=10`
900+
* `TCP_KEEPINTVL=1`
901+
890902
### `socket.setNoDelay([noDelay])`
891903
<!-- YAML
892904
added: v0.1.90

0 commit comments

Comments
 (0)