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: keepAliveMsecs refers to an initial delay not interval #10702

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
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
4 changes: 2 additions & 2 deletions doc/api/http.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,8 @@ added: v0.3.4
Can have the following fields:
* `keepAlive` {Boolean} Keep sockets around in a pool to be used by
other requests in the future. Default = `false`
* `keepAliveMsecs` {Integer} When using HTTP KeepAlive, how often
to send TCP KeepAlive packets over sockets being kept alive.
* `keepAliveMsecs` {Integer} When using HTTP KeepAlive, the initial delay
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Still confusing.... the TCP keep alive socket option is not directly related to node's HTTP keepAlive option. Keep Alive packets will be sent whenever there is no data flowing over the socket for some period of time, whether HTTP keepAlive is enabled or not. Could you clarify?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed, tried to make it more similar to socket.setKeepAlive

Set initialDelay (in milliseconds) to set the delay between the last data packet received and the first keepalive probe. Setting 0 for initialDelay will leave the value unchanged from the default (or previous) setting. Defaults to 0.

The main thing that should be changed is that its not related to how often it sends, but how long the idle is, as we see here it refers to TCP_KEEPIDLE in unix, not TCP_KEEPINTVL

between the last data packet and the first TCP KeepAlive packet.
Default = `1000`. Only relevant if `keepAlive` is set to `true`.
* `maxSockets` {Number} Maximum number of sockets to allow per
host. Default = `Infinity`.
Expand Down