src: lint lib/net.js
This commit is contained in:
parent
bc2f31ae1d
commit
b0e5f195df
13
lib/net.js
13
lib/net.js
@ -1070,12 +1070,13 @@ function listen(self, address, port, addressType, backlog, fd) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Some operating systems (notably OS X and Solaris) don't report EADDRINUSE
|
// Some operating systems (notably OS X and Solaris) don't report
|
||||||
// errors right away. libuv mimics that behavior for the sake of platform
|
// EADDRINUSE errors right away. libuv mimics that behavior for the
|
||||||
// consistency but that means we have have a socket on our hands that is
|
// sake of platform consistency but that means we have have a socket on
|
||||||
// not actually bound. That's why we check if the actual port matches what
|
// our hands that is not actually bound. That's why we check if the
|
||||||
// we requested and if not, raise an error. The exception is when port == 0
|
// actual port matches what we requested and if not, raise an error.
|
||||||
// because that means "any random port".
|
// The exception is when port == 0 because that means "any random
|
||||||
|
// port".
|
||||||
if (port && handle.getsockname && port != handle.getsockname().port) {
|
if (port && handle.getsockname && port != handle.getsockname().port) {
|
||||||
self.emit('error', errnoException('EADDRINUSE', 'bind'));
|
self.emit('error', errnoException('EADDRINUSE', 'bind'));
|
||||||
return;
|
return;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user