diff options
author | Eli Skeggs <skeggse@gmail.com> | 2014-06-27 22:32:50 -0700 |
---|---|---|
committer | Trevor Norris <trev.norris@gmail.com> | 2014-07-02 12:35:06 -0700 |
commit | 1100f3de7a2053d98f6ee81703df2d5bd17523d1 (patch) | |
tree | b9d54c144905567ff0a078e52421bb0eedf836f0 /lib | |
parent | 613654e882d9b3eda43680de0811d5f52caed994 (diff) | |
download | nodejs-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.js | 4 |
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'); }); }; |