Skip to content

doc: clarify socket and keepAliveTimeout interaction#25748

Closed
inversion wants to merge 1 commit intonodejs:masterfrom
inversion:doc-clarify-http-keepAliveTimeout
Closed

doc: clarify socket and keepAliveTimeout interaction#25748
inversion wants to merge 1 commit intonodejs:masterfrom
inversion:doc-clarify-http-keepAliveTimeout

Conversation

@inversion
Copy link
Contributor

@inversion inversion commented Jan 27, 2019

doc: clarify socket and keepAliveTimeout interaction

Socket timeouts set using the connection event are replaced by
server.keepAliveTimeout when a response is handled.

Socket timeouts set in the connection event are replaced after a response is sent in the resOnFinish handler

server.on('connection', function(socket) {
  socket.setTimeout(60000);
});

In this case, the socket timeout is 60 seconds until a response is sent, at which point it becomes 5 seconds (the server.keepAliveTimeout default). This bit me when working with load balancers that maintain long-lived connections.

I have added a note to the connection event docs to the effect that is preferred to use server.keepAliveTimeout.

Checklist

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

author ready PRs that have at least one approval, no pending requests for changes, and a CI started. doc Issues and PRs related to the documentations. http Issues or PRs related to the http subsystem.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants