Skip to content

Commit 85f70b3

Browse files
TrottMyles Borins
authored and
Myles Borins
committed
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 57ba51e commit 85f70b3

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

doc/api/http.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -532,8 +532,8 @@ a listener for the `'listening'` event. See also [`net.Server.listen(path)`][].
532532

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

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

doc/api/net.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -178,8 +178,8 @@ The parameter `backlog` behaves the same as in
178178

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

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

0 commit comments

Comments
 (0)