errnoException must be done immediately

pull/24503/head
isaacs 2012-08-05 14:22:44 -07:00
parent 99ad0561c0
commit 74d076caf1
1 changed files with 2 additions and 1 deletions

View File

@ -926,8 +926,9 @@ function listen(self, address, port, addressType, backlog, fd) {
if (!self._handle) {
self._handle = createServerHandle(address, port, addressType, fd);
if (!self._handle) {
var error = errnoException(errno, 'listen');
process.nextTick(function() {
self.emit('error', errnoException(errno, 'listen'));
self.emit('error', error);
});
return;
}