Skip to content

Commit 97f0ad8

Browse files
committed
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: #31378 Fixes: #27556 Refs: #27704
1 parent 43fb6ff commit 97f0ad8

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

doc/api/net.md

+6
Original file line numberDiff line numberDiff line change
@@ -895,6 +895,9 @@ added: v0.1.90
895895
Sets the socket to timeout after `timeout` milliseconds of inactivity on
896896
the socket. By default `net.Socket` do not have a timeout.
897897

898+
> Note: Prior to Node.js 13.0.0, [`http.Server`][], [`https.Server`][] and
899+
> [`http2.Http2Server`][] have a different default socket timeout value.
900+
898901
When an idle timeout is triggered the socket will receive a [`'timeout'`][]
899902
event but the connection will not be severed. The user must manually call
900903
[`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`.
12441247
[`net.createConnection(port, host)`]: #net_net_createconnection_port_host_connectlistener
12451248
[`net.createServer()`]: #net_net_createserver_options_connectionlistener
12461249
[`new net.Socket(options)`]: #net_new_net_socket_options
1250+
[`http.Server`]: http.html#http_class_http_server
1251+
[`http2.Http2Server`]: http2.html#http2_class_http2server
1252+
[`https.Server`]: https.html#https_class_https_server
12471253
[`readable.setEncoding()`]: stream.html#stream_readable_setencoding_encoding
12481254
[`server.close()`]: #net_server_close_callback
12491255
[`server.getConnections()`]: #net_server_getconnections_callback

0 commit comments

Comments
 (0)