Skip to content

Commit a7d8139

Browse files
Trottevanlucas
authored andcommitted
doc: clarify use of 0 port value
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 <[email protected]> Reviewed-By: cjihrig - Colin Ihrig <[email protected]> Reviewed-By: Anna Henningsen <[email protected]>
1 parent 5e5af8b commit a7d8139

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

doc/api/http.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -577,8 +577,8 @@ a listener for the `'listening'` event. See also [`net.Server.listen(path)`][].
577577

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

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

doc/api/net.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -218,8 +218,8 @@ added: v0.1.90
218218

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

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

0 commit comments

Comments
 (0)