Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

doc: document new TCP_KEEPCNT and TCP_KEEPINTVL socket option defaults #38313

Closed
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
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
  • Loading branch information
ArnoldZokas committed Apr 20, 2021
commit 95a4f96cedf2bdd613bc6167963c2ffb04deaf0d
10 changes: 10 additions & 0 deletions doc/api/net.md
Original file line number Diff line number Diff line change
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
ArnoldZokas marked this conversation as resolved.
Show resolved Hide resolved
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