Skip to content
This repository has been archived by the owner on Apr 22, 2023. It is now read-only.

Commit

Permalink
Docs for server.address()
Browse files Browse the repository at this point in the history
  • Loading branch information
ry committed Nov 16, 2010
1 parent 90d1e47 commit e5cc638
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions doc/api/net.markdown
Expand Up @@ -86,6 +86,25 @@ Stops the server from accepting new connections. This function is
asynchronous, the server is finally closed when the server emits a `'close'`
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

This comment has been minimized.

Copy link
@TooTallNate

TooTallNate Nov 16, 2010

remove "giving" from this line


Example:

var server = net.createServer(function (socket) {
socket.end("goodbye\n");
});

// grab a random port.
server.listen(function() {
address = server.address();
console.log("opened server on %j", address);
});


#### server.maxConnections

Set this property to reject connections when the server's connection count gets high.
Expand Down

0 comments on commit e5cc638

Please sign in to comment.