From 97f0ad864f27b432ce90f3d563175d13afb86418 Mon Sep 17 00:00:00 2001 From: Antoine du HAMEL Date: Thu, 16 Jan 2020 14:03:48 +0100 Subject: [PATCH 1/3] doc: add note regarding net.Socket default timeout Prior to Node.js v13, http[2s] have a specific default timeout value which should not be confused with net.Socket default timeout. Fixes: https://github.com/nodejs/node/issues/31378 Fixes: https://github.com/nodejs/node/issues/27556 Refs: https://github.com/nodejs/node/pull/27704 --- doc/api/net.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/doc/api/net.md b/doc/api/net.md index d04e7eff0789a7..b14389c298030f 100644 --- a/doc/api/net.md +++ b/doc/api/net.md @@ -895,6 +895,9 @@ added: v0.1.90 Sets the socket to timeout after `timeout` milliseconds of inactivity on the socket. By default `net.Socket` do not have a timeout. + > Note: Prior to Node.js 13.0.0, [`http.Server`][], [`https.Server`][] and + > [`http2.Http2Server`][] have a different default socket timeout value. + When an idle timeout is triggered the socket will receive a [`'timeout'`][] event but the connection will not be severed. The user must manually call [`socket.end()`][] or [`socket.destroy()`][] to end the connection. @@ -1244,6 +1247,9 @@ Returns `true` if input is a version 6 IP address, otherwise returns `false`. [`net.createConnection(port, host)`]: #net_net_createconnection_port_host_connectlistener [`net.createServer()`]: #net_net_createserver_options_connectionlistener [`new net.Socket(options)`]: #net_new_net_socket_options +[`http.Server`]: http.html#http_class_http_server +[`http2.Http2Server`]: http2.html#http2_class_http2server +[`https.Server`]: https.html#https_class_https_server [`readable.setEncoding()`]: stream.html#stream_readable_setencoding_encoding [`server.close()`]: #net_server_close_callback [`server.getConnections()`]: #net_server_getconnections_callback From d5ef72ab6aacbd8cba53da428346f4e148e0d9a7 Mon Sep 17 00:00:00 2001 From: Antoine du Hamel Date: Fri, 31 Jan 2020 05:30:58 -0500 Subject: [PATCH 2/3] nit Co-Authored-By: Rich Trott --- doc/api/net.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/api/net.md b/doc/api/net.md index b14389c298030f..17a6a13ec62722 100644 --- a/doc/api/net.md +++ b/doc/api/net.md @@ -895,7 +895,7 @@ added: v0.1.90 Sets the socket to timeout after `timeout` milliseconds of inactivity on the socket. By default `net.Socket` do not have a timeout. - > Note: Prior to Node.js 13.0.0, [`http.Server`][], [`https.Server`][] and +Prior to Node.js 13.0.0, [`http.Server`][], [`https.Server`][] and > [`http2.Http2Server`][] have a different default socket timeout value. When an idle timeout is triggered the socket will receive a [`'timeout'`][] From 8cf38a00338b7c15b5cf339ed3c6b33169c6bc59 Mon Sep 17 00:00:00 2001 From: Antoine du HAMEL Date: Fri, 31 Jan 2020 11:32:35 +0100 Subject: [PATCH 3/3] nit --- doc/api/net.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/api/net.md b/doc/api/net.md index 17a6a13ec62722..e533ebc17f6449 100644 --- a/doc/api/net.md +++ b/doc/api/net.md @@ -896,7 +896,7 @@ Sets the socket to timeout after `timeout` milliseconds of inactivity on the socket. By default `net.Socket` do not have a timeout. Prior to Node.js 13.0.0, [`http.Server`][], [`https.Server`][] and - > [`http2.Http2Server`][] have a different default socket timeout value. +[`http2.Http2Server`][] have a different default socket timeout value. When an idle timeout is triggered the socket will receive a [`'timeout'`][] event but the connection will not be severed. The user must manually call