Skip to content

Commit b3d6b64

Browse files
committed
doc: clarify server keep-alive options
Signed-off-by: mukunda katta <mukunda.vjcs6@gmail.com>
1 parent f190a04 commit b3d6b64

2 files changed

Lines changed: 14 additions & 12 deletions

File tree

doc/api/http.md

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2016,10 +2016,9 @@ socketTimeout = keepAliveTimeout + keepAliveTimeoutBuffer
20162016
If the server receives new data before the keep-alive timeout has fired, it
20172017
will reset the regular inactivity timeout, i.e., [`server.timeout`][].
20182018

2019-
A value of `0` will disable the keep-alive timeout behavior on incoming
2020-
connections.
2021-
A value of `0` makes the HTTP server behave similarly to Node.js versions prior
2022-
to 8.0.0, which did not have a keep-alive timeout.
2019+
A value of `0` disables only this idle keep-alive timeout. HTTP keep-alive
2020+
connections may remain open until the client closes them, the server closes
2021+
them, or another timeout applies.
20232022

20242023
The socket timeout logic is set up on connection, so changing this value only
20252024
affects new connections to the server, not any existing connections.
@@ -3717,10 +3716,13 @@ changes:
37173716
a comma (`, `) instead of discarding the duplicates.
37183717
For more information, refer to [`message.headers`][].
37193718
**Default:** `false`.
3720-
* `keepAlive` {boolean} If set to `true`, it enables keep-alive functionality
3721-
on the socket immediately after a new incoming connection is received,
3722-
similarly on what is done in \[`socket.setKeepAlive([enable][, initialDelay])`]\[`socket.setKeepAlive(enable, initialDelay)`].
3723-
**Default:** `false`.
3719+
* `keepAlive` {boolean} If set to `true`, enables TCP keep-alive on the
3720+
socket immediately after a new incoming connection is received, similarly
3721+
to what is done in \[`socket.setKeepAlive([enable][, initialDelay])`]\[`socket.setKeepAlive(enable, initialDelay)`].
3722+
If `false`, no call to
3723+
\[`socket.setKeepAlive([enable][, initialDelay])`]\[`socket.setKeepAlive(enable, initialDelay)`]
3724+
is made. This does not disable HTTP persistent connections. **Default:**
3725+
`false`.
37243726
* `keepAliveInitialDelay` {number} If set to a positive number, it sets the
37253727
initial delay before the first keepalive probe is sent on an idle socket.
37263728
**Default:** `0`.

doc/api/net.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1818,10 +1818,10 @@ changes:
18181818
* `highWaterMark` {number} Optionally overrides all [`net.Socket`][]s'
18191819
`readableHighWaterMark` and `writableHighWaterMark`.
18201820
**Default:** See [`stream.getDefaultHighWaterMark()`][].
1821-
* `keepAlive` {boolean} If set to `true`, it enables keep-alive functionality
1822-
on the socket immediately after a new incoming connection is received,
1823-
similarly on what is done in [`socket.setKeepAlive()`][]. **Default:**
1824-
`false`.
1821+
* `keepAlive` {boolean} If set to `true`, enables TCP keep-alive on the
1822+
socket immediately after a new incoming connection is received, similarly
1823+
to what is done in [`socket.setKeepAlive()`][]. If `false`, no call to
1824+
[`socket.setKeepAlive()`][] is made. **Default:** `false`.
18251825
* `keepAliveInitialDelay` {number} If set to a positive number, it sets the
18261826
initial delay before the first keepalive probe is sent on an idle socket.
18271827
**Default:** `0`.

0 commit comments

Comments
 (0)