Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions doc/api/net.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Prior to Node.js 13.0.0, [`http.Server`][], [`https.Server`][] and
[`http2.Http2Server`][] have a different default socket timeout value.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we incorporate this information into the YAML matter instead of having it here?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we incorporate this information into the YAML matter instead of having it here?

Oh, wait, no, not that YAML matter. What's the rationale for putting this in net instead of http, https, and http2 docs?

Copy link
Contributor Author

@aduh95 aduh95 Feb 4, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Apparently some users are referring to net docs when working with http.Server (see #31378); prior to Node.js 13, default values are consistent across all sockets in Node.js codebase EXCEPT for the timeout, I figured adding a note would help avoid the confusion.
Users who refer to http[s2] docs already have the correct information, I'm not sure there is much confusion from that side.


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.
Expand Down Expand Up @@ -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
Expand Down