From 534264d2091e9662e73bc9bdab18b386831428f5 Mon Sep 17 00:00:00 2001 From: Shigeki Ohtsu Date: Thu, 15 Mar 2012 23:44:00 +0900 Subject: [PATCH] doc: Add condition to emit close event of net.Server --- doc/api/net.markdown | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/doc/api/net.markdown b/doc/api/net.markdown index 26c0d9dbf0..dbfced3e27 100644 --- a/doc/api/net.markdown +++ b/doc/api/net.markdown @@ -160,10 +160,11 @@ the last parameter `listeningListener` will be added as an listener for the ### server.close([cb]) -Stops the server from accepting new connections. This function is -asynchronous, the server is finally closed when the server emits a `'close'` -event. Optionally, you can pass a callback to listen for the `'close'` event. - +Stops the server from accepting new connections and keeps existing +connections. This function is asynchronous, the server is finally +closed when all connections are ended and the server emits a `'close'` +event. Optionally, you can pass a callback to listen for the `'close'` +event. ### server.address() @@ -210,7 +211,8 @@ Emitted when a new connection is made. `socket` is an instance of ### Event: 'close' -Emitted when the server closes. +Emitted when the server closes. Note that if connections exist, this +event is not emitted until all connections are ended. ### Event: 'error'