Skip to content

Commit

Permalink
doc: document new TCP_KEEPCNT and TCP_KEEPINTVL socket option defaults
Browse files Browse the repository at this point in the history
PR nodejs#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: nodejs#38298
Refs: nodejs#32204
  • Loading branch information
ArnoldZokas committed Apr 20, 2021
1 parent a0261d2 commit 95a4f96
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions doc/api/net.md
Expand Up @@ -1006,6 +1006,10 @@ Set the encoding for the socket as a [Readable Stream][]. See
### `socket.setKeepAlive([enable][, initialDelay])`
<!-- YAML
added: v0.1.92
changes:
- version: v12.17.0
pr-url: https://github.com/nodejs/node/pull/32204
description: New defaults for `TCP_KEEPCNT` and `TCP_KEEPINTVL` socket options were added.
-->

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

Enabling the keep-alive functionality will set the following socket options:
* `SO_KEEPALIVE=1`
* `TCP_KEEPIDLE=initialDelay`
* `TCP_KEEPCNT=10`
* `TCP_KEEPINTVL=1`

### `socket.setNoDelay([noDelay])`
<!-- YAML
added: v0.1.90
Expand Down

0 comments on commit 95a4f96

Please sign in to comment.