Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

src: lint lib/net.js

  • Loading branch information...
commit b0e5f195dfce3e2b99f5091373d49f6616682596 1 parent bc2f31a
@tjfontaine tjfontaine authored
Showing with 21 additions and 20 deletions.
  1. +21 −20 lib/net.js
View
41 lib/net.js
@@ -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;
- }
-
- // 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);
- });
+ // 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;
+ }
+
+ self._handle = handle;
+ self._listen2(address, port, addressType, backlog, fd);
+ });
}
Please sign in to comment.
Something went wrong with that request. Please try again.