Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 14afb39

Browse filesBrowse 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 ed5ef21 commit 14afb39
Copy full SHA for 14afb39

File tree

Expand file treeCollapse file tree

1 file changed

+12
-0
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+12
-0
lines changed
Open diff view settings
Collapse file

‎doc/api/net.md‎

Copy file name to clipboardExpand all lines: doc/api/net.md
+12Lines changed: 12 additions & 0 deletions
  • Display the source diff
  • Display the rich diff
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 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.