Docs: server.pause() server.address() socket.address()
authorRyan Dahl <ry@tinyclouds.org>
Mon, 9 May 2011 17:49:20 +0000 (10:49 -0700)
committerRyan Dahl <ry@tinyclouds.org>
Mon, 9 May 2011 17:49:27 +0000 (10:49 -0700)
doc/api/net.markdown

index dded333..16baacb 100644 (file)
@@ -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,