Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

doc: fix net.Server.listen bind behavior #503

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
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
7 changes: 4 additions & 3 deletions doc/api/http.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -162,9 +162,10 @@ If a client connection emits an 'error' event, it will be forwarded here.

### server.listen(port[, hostname][, backlog][, callback])

Begin accepting connections on the specified port and hostname. If the
hostname is omitted, the server will accept connections directed to any
IPv4 address (`INADDR_ANY`).
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.

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

Expand Down
9 changes: 5 additions & 4 deletions doc/api/net.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -137,11 +137,12 @@ A factory method which returns a new ['net.Socket'](#net_class_net_socket).

This class is used to create a TCP or local server.

### server.listen(port[, host][, backlog][, callback])
### server.listen(port[, hostname][, backlog][, callback])

Begin accepting connections on the specified `port` and `host`. If the
`host` is omitted, the server will accept connections directed to any
IPv4 address (`INADDR_ANY`). A port value of zero will assign a random port.
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.

Backlog is the maximum length of the queue of pending connections.
The actual length will be determined by your OS through sysctl settings such as
Expand Down
9 changes: 5 additions & 4 deletions doc/api/tls.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -586,11 +586,12 @@ NOTE: you may want to use some npm module like [asn1.js] to parse the
certificates.


### server.listen(port[, host][, callback])
### server.listen(port[, hostname][, callback])

Begin accepting connections on the specified `port` and `host`. If the
`host` is omitted, the server will accept connections directed to any
IPv4 address (`INADDR_ANY`).
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.

This function is asynchronous. The last parameter `callback` will be called
when the server has been bound.
Expand Down