Docs: server.pause() server.address() socket.address()
This commit is contained in:
parent
31ed87b0a9
commit
11beac70e2
@ -106,6 +106,12 @@ Start a server listening for connections on the given file descriptor.
|
|||||||
This file descriptor must have already had the `bind(2)` and `listen(2)` system
|
This file descriptor must have already had the `bind(2)` and `listen(2)` system
|
||||||
calls invoked on it.
|
calls invoked on it.
|
||||||
|
|
||||||
|
#### server.pause(msecs)
|
||||||
|
|
||||||
|
Stop accepting connections for the given number of milliseconds (default is
|
||||||
|
one second). This could be useful for throttling new connections against
|
||||||
|
DoS attacks or other oversubscription.
|
||||||
|
|
||||||
#### server.close()
|
#### server.close()
|
||||||
|
|
||||||
Stops the server from accepting new connections. This function is
|
Stops the server from accepting new connections. This function is
|
||||||
@ -115,8 +121,9 @@ event.
|
|||||||
|
|
||||||
#### server.address()
|
#### server.address()
|
||||||
|
|
||||||
Returns the bound address of the server as seen by the operating system.
|
Returns the bound address and port of the server as reported by the operating system.
|
||||||
Useful to find which port was assigned when giving getting an OS-assigned address
|
Useful to find which port was assigned when giving getting an OS-assigned address.
|
||||||
|
Returns an object with two properties, e.g. `{"address":"127.0.0.1", "port":2121}`
|
||||||
|
|
||||||
Example:
|
Example:
|
||||||
|
|
||||||
@ -298,6 +305,11 @@ data packet received and the first keepalive probe. Setting 0 for
|
|||||||
initialDelay will leave the value unchanged from the default
|
initialDelay will leave the value unchanged from the default
|
||||||
(or previous) setting.
|
(or previous) setting.
|
||||||
|
|
||||||
|
#### socket.address()
|
||||||
|
|
||||||
|
Returns the bound address and port of the socket as reported by the operating system.
|
||||||
|
Returns an object with two properties, e.g. `{"address":"192.168.57.1", "port":62053}`
|
||||||
|
|
||||||
#### socket.remoteAddress
|
#### socket.remoteAddress
|
||||||
|
|
||||||
The string representation of the remote IP address. For example,
|
The string representation of the remote IP address. For example,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user