From: Ryan Dahl Date: Mon, 9 May 2011 17:49:20 +0000 (-0700) Subject: Docs: server.pause() server.address() socket.address() X-Git-Tag: v0.4.8~25 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=11beac70e22dd4fc2611cada19ca30031df8fa41;p=platform%2Fupstream%2Fnodejs.git Docs: server.pause() server.address() socket.address() --- diff --git a/doc/api/net.markdown b/doc/api/net.markdown index dded333..16baacb 100644 --- a/doc/api/net.markdown +++ b/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,