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

Wrong definition of keepAliveMsecs in http.Agent documentation #7335

Closed
calibr opened this issue Jun 18, 2016 · 3 comments
Closed

Wrong definition of keepAliveMsecs in http.Agent documentation #7335

calibr opened this issue Jun 18, 2016 · 3 comments
Labels
doc Issues and PRs related to the documentations. http Issues or PRs related to the http subsystem.

Comments

@calibr
Copy link

calibr commented Jun 18, 2016

Documentation for keepAliveMsecs says:

 When using HTTP KeepAlive,
 how often to send TCP KeepAlive packets over sockets being kept alive.

But internally http.Agent just uses keepAliveMsecs in socket.setKeepAlive(true, self.keepAliveMsecs); (https://github.com/nodejs/node/blob/master/lib/_http_agent.js#L73)

From docs for socket.setKeepAlive([enable][, initialDelay]):

Set initialDelay (in milliseconds) to set the delay between
the last data packet received and the first keepalive probe.

So really keepAliveMsecs doesn't mean how often keep alive probe will be sent, it means delay between the last data received and the first keep alive probe.

@mscdex mscdex added http Issues or PRs related to the http subsystem. doc Issues and PRs related to the documentations. labels Jun 18, 2016
@jasnell
Copy link
Member

jasnell commented Jun 28, 2016

@nodejs/http @nodejs/documentation

@dougwilson
Copy link
Member

This is correct, in that the HTTP client documentation is not correct, as the time is only the initial delay of the keep alive probe, not the interval between the probes. nodejs/node-v0.x-archive#4109 has a good discussion about this, though all Node.js documentation (and even the libuv documentation) are very terse on this subject and not very clear :)

@calibr
Copy link
Author

calibr commented Feb 25, 2017

doc fixed by 3b9e8ad

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
doc Issues and PRs related to the documentations. http Issues or PRs related to the http subsystem.
Projects
None yet
Development

No branches or pull requests

4 participants