summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorEli Skeggs <skeggse@gmail.com>2014-06-27 22:32:50 -0700
committerTrevor Norris <trev.norris@gmail.com>2014-07-02 12:35:06 -0700
commit1100f3de7a2053d98f6ee81703df2d5bd17523d1 (patch)
treeb9d54c144905567ff0a078e52421bb0eedf836f0 /lib
parent613654e882d9b3eda43680de0811d5f52caed994 (diff)
downloadnodejs-1100f3de7a2053d98f6ee81703df2d5bd17523d1.tar.gz
nodejs-1100f3de7a2053d98f6ee81703df2d5bd17523d1.tar.bz2
nodejs-1100f3de7a2053d98f6ee81703df2d5bd17523d1.zip
net: don't emit listening if handle is closed
Fixes #7834 Signed-off-by: Trevor Norris <trev.norris@gmail.com>
Diffstat (limited to 'lib')
-rw-r--r--lib/net.js4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/net.js b/lib/net.js
index 770f34ed4..eda9d84ad 100644
--- a/lib/net.js
+++ b/lib/net.js
@@ -1136,7 +1136,9 @@ Server.prototype._listen2 = function(address, port, addressType, backlog, fd) {
this._connectionKey = addressType + ':' + address + ':' + port;
process.nextTick(function() {
- self.emit('listening');
+ // ensure handle hasn't closed
+ if (self._handle)
+ self.emit('listening');
});
};