src: lint lib/net.js

This commit is contained in:
Timothy J Fontaine 2014-01-22 21:05:51 -08:00
parent bc2f31ae1d
commit b0e5f195df

View File

@ -1064,26 +1064,27 @@ function listen(self, address, port, addressType, backlog, fd) {
cluster._getServer(self, address, port, addressType, fd, function(handle,
err) {
// EACCESS and friends
if (err) {
self.emit('error', errnoException(err, 'bind'));
return;
}
// EACCESS and friends
if (err) {
self.emit('error', errnoException(err, 'bind'));
return;
}
// Some operating systems (notably OS X and Solaris) don't report EADDRINUSE
// errors right away. libuv mimics that behavior for the sake of platform
// consistency but that means we have have a socket on our hands that is
// not actually bound. That's why we check if the actual port matches what
// we requested and if not, raise an error. The exception is when port == 0
// because that means "any random port".
if (port && handle.getsockname && port != handle.getsockname().port) {
self.emit('error', errnoException('EADDRINUSE', 'bind'));
return;
}
// Some operating systems (notably OS X and Solaris) don't report
// EADDRINUSE errors right away. libuv mimics that behavior for the
// sake of platform consistency but that means we have have a socket on
// our hands that is not actually bound. That's why we check if the
// actual port matches what we requested and if not, raise an error.
// The exception is when port == 0 because that means "any random
// port".
if (port && handle.getsockname && port != handle.getsockname().port) {
self.emit('error', errnoException('EADDRINUSE', 'bind'));
return;
}
self._handle = handle;
self._listen2(address, port, addressType, backlog, fd);
});
self._handle = handle;
self._listen2(address, port, addressType, backlog, fd);
});
}