http: destroy sockets after keepAliveTimeout

Implement server.keepAliveTimeout in addition to server.timeout to
prevent temporary socket/memory leaking in keep-alive mode.

PR-URL: https://github.com/nodejs/node/pull/2534
Author: Timur Shemsedinov <timur.shemsedinov@gmail.com>
Author: Alexey Orlenko <eaglexrlnk@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
This commit is contained in:
Timur Shemsedinov
2015-10-29 21:53:43 +02:00
committed by Alexey Orlenko
parent 21c0c0275a
commit 0aa7ef5950
6 changed files with 252 additions and 11 deletions

View File

@@ -38,6 +38,14 @@ added: v0.11.2
See [`http.Server#timeout`][].
### server.keepAliveTimeout
<!-- YAML
added: REPLACEME
-->
- {number} Defaults to 5000 (5 seconds).
See [`http.Server#keepAliveTimeout`][].
## https.createServer(options[, requestListener])
<!-- YAML
added: v0.3.4
@@ -229,6 +237,7 @@ const req = https.request(options, (res) => {
[`Agent`]: #https_class_https_agent
[`http.Agent`]: http.html#http_class_http_agent
[`http.Server#keepAliveTimeout`]: http.html#http_server_keepalivetimeout
[`http.Server#setTimeout()`]: http.html#http_server_settimeout_msecs_callback
[`http.Server#timeout`]: http.html#http_server_timeout
[`http.Server`]: http.html#http_class_http_server