Browse Source

Docs: server.pause() server.address() socket.address()

v0.7.4-release
Ryan Dahl 14 years ago
parent
commit
11beac70e2
  1. 16
      doc/api/net.markdown

16
doc/api/net.markdown

@ -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
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()
Stops the server from accepting new connections. This function is
@ -115,8 +121,9 @@ event.
#### server.address()
Returns the bound address of the server as seen by the operating system.
Useful to find which port was assigned when giving getting an OS-assigned address
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.
Returns an object with two properties, e.g. `{"address":"127.0.0.1", "port":2121}`
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
(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
The string representation of the remote IP address. For example,

Loading…
Cancel
Save