Skip to content

Commit 9b81617

Browse files
committed
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
1 parent a0261d2 commit 9b81617

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

doc/api/net.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1006,6 +1006,10 @@ Set the encoding for the socket as a [Readable Stream][]. See
10061006
### `socket.setKeepAlive([enable][, initialDelay])`
10071007
<!-- YAML
10081008
added: v0.1.92
1009+
changes:
1010+
- version: v12.17.0
1011+
pr-url: https://github.com/nodejs/node/pull/32204
1012+
description: New defaults for `TCP_KEEPCNT` and `TCP_KEEPINTVL` socket options were added.
10091013
-->
10101014

10111015
* `enable` {boolean} **Default:** `false`
@@ -1020,6 +1024,12 @@ data packet received and the first keepalive probe. Setting `0` for
10201024
`initialDelay` will leave the value unchanged from the default
10211025
(or previous) setting.
10221026

1027+
Enabling the keep-alive functionality will set the following socket options:
1028+
- `SO_KEEPALIVE=1`
1029+
- `TCP_KEEPIDLE=initialDelay`
1030+
- `TCP_KEEPCNT=10`
1031+
- `TCP_KEEPINTVL=1`
1032+
10231033
### `socket.setNoDelay([noDelay])`
10241034
<!-- YAML
10251035
added: v0.1.90

0 commit comments

Comments
 (0)