Skip to content

Commit 488d37b

Browse files
committed
doc: doc that listen can be called multiple times
Fixes: #4646 PR-URL: #8294 Reviewed-By: Colin Ihrig <[email protected]>
1 parent 61fa50d commit 488d37b

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

doc/api/http.md

+9
Original file line numberDiff line numberDiff line change
@@ -681,6 +681,9 @@ This function is asynchronous. `callback` will be added as a listener for the
681681

682682
Returns `server`.
683683

684+
*Note*: The `server.listen()` method may be called multiple times. Each
685+
subsequent call will *re-open* the server using the provided options.
686+
684687
### server.listen(path[, callback])
685688
<!-- YAML
686689
added: v0.1.90
@@ -691,6 +694,9 @@ Start a UNIX socket server listening for connections on the given `path`.
691694
This function is asynchronous. `callback` will be added as a listener for the
692695
[`'listening'`][] event. See also [`net.Server.listen(path)`][].
693696

697+
*Note*: The `server.listen()` method may be called multiple times. Each
698+
subsequent call will *re-open* the server using the provided options.
699+
694700
### server.listen([port][, hostname][, backlog][, callback])
695701
<!-- YAML
696702
added: v0.1.90
@@ -713,6 +719,9 @@ parameter is 511 (not 512).
713719
This function is asynchronous. `callback` will be added as a listener for the
714720
[`'listening'`][] event. See also [`net.Server.listen(port)`][].
715721

722+
*Note*: The `server.listen()` method may be called multiple times. Each
723+
subsequent call will *re-open* the server using the provided options.
724+
716725
### server.listening
717726
<!-- YAML
718727
added: v5.7.0

doc/api/net.md

+9
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,9 @@ server.listen({
173173
});
174174
```
175175

176+
*Note*: The `server.listen()` method may be called multiple times. Each
177+
subsequent call will *re-open* the server using the provided options.
178+
176179
### server.listen(path[, backlog][, callback])
177180
<!-- YAML
178181
added: v0.1.90
@@ -210,6 +213,9 @@ double-backslashes, such as:
210213
The parameter `backlog` behaves the same as in
211214
[`server.listen([port][, hostname][, backlog][, callback])`][`server.listen(port, host, backlog, callback)`].
212215

216+
*Note*: The `server.listen()` method may be called multiple times. Each
217+
subsequent call will *re-open* the server using the provided options.
218+
213219
### server.listen([port][, hostname][, backlog][, callback])
214220
<!-- YAML
215221
added: v0.1.90
@@ -249,6 +255,9 @@ server.on('error', (e) => {
249255

250256
(Note: All sockets in Node.js are set `SO_REUSEADDR`.)
251257

258+
*Note*: The `server.listen()` method may be called multiple times. Each
259+
subsequent call will *re-open* the server using the provided options.
260+
252261
### server.listening
253262
<!-- YAML
254263
added: v5.7.0

0 commit comments

Comments
 (0)