Skip to content

Commit

Permalink
doc: clarify use of 0 port value
Browse files Browse the repository at this point in the history
Clarify that using a port value of `0` will result in the operating
system identifying an available port for use.

PR-URL: #7206
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: cjihrig - Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
  • Loading branch information
Trott authored and Myles Borins committed Jul 14, 2016
1 parent 57ba51e commit 85f70b3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions doc/api/http.md
Original file line number Diff line number Diff line change
Expand Up @@ -532,8 +532,8 @@ a listener for the `'listening'` event. See also [`net.Server.listen(path)`][].

Begin accepting connections on the specified `port` and `hostname`. If the
`hostname` is omitted, the server will accept connections on any IPv6 address
(`::`) when IPv6 is available, or any IPv4 address (`0.0.0.0`) otherwise. A
port value of zero will assign a random port.
(`::`) when IPv6 is available, or any IPv4 address (`0.0.0.0`) otherwise. Use a
port value of zero to have the operating system assign an available port.

To listen to a unix socket, supply a filename instead of port and hostname.

Expand Down
4 changes: 2 additions & 2 deletions doc/api/net.md
Original file line number Diff line number Diff line change
Expand Up @@ -178,8 +178,8 @@ The parameter `backlog` behaves the same as in

Begin accepting connections on the specified `port` and `hostname`. If the
`hostname` is omitted, the server will accept connections on any IPv6 address
(`::`) when IPv6 is available, or any IPv4 address (`0.0.0.0`) otherwise. A
port value of zero will assign a random port.
(`::`) when IPv6 is available, or any IPv4 address (`0.0.0.0`) otherwise. Use a
port value of `0` to have the operating system assign an available port.

Backlog is the maximum length of the queue of pending connections.
The actual length will be determined by the OS through sysctl settings such as
Expand Down

0 comments on commit 85f70b3

Please sign in to comment.