mirror of
https://github.com/nodejs/node.git
synced 2024-11-21 10:59:27 +00:00
net: fix bogus errno reporting
_listen2() emits the error on the next tick. The errno value may have changed by then.
This commit is contained in:
parent
c6bb361b84
commit
5d97d72753
@ -911,10 +911,11 @@ Server.prototype._listen2 = function(address, port, addressType, backlog, fd) {
|
||||
r = self._handle.listen(backlog || 511);
|
||||
|
||||
if (r) {
|
||||
var ex = errnoException(errno, 'listen');
|
||||
self._handle.close();
|
||||
self._handle = null;
|
||||
process.nextTick(function() {
|
||||
self.emit('error', errnoException(errno, 'listen'));
|
||||
self.emit('error', ex);
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user