Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
Browse files

Revert "cluster: propagate bind errors"

This reverts commit 30e462e.
  • Loading branch information...
isaacs committed Feb 17, 2012
1 parent e16c6c7 commit 4b8c73a258d5e04effbb697dc401bacc8141e7b0
@@ -756,26 +756,14 @@ Server.prototype._listen2 = function(address, port, addressType) {


function listen(self, address, port, addressType) {
if (!process.env.NODE_WORKER_ID) {
if (process.env.NODE_WORKER_ID) {
require('cluster')._getServer(address, port, addressType, function(handle) {
self._handle = handle;
self._listen2(address, port, addressType);
});
} else {
self._listen2(address, port, addressType);
return;
}

require('cluster')._getServer(address, port, addressType, function(handle) {
// OS X doesn't necessarily signal EADDRINUSE from bind(), it may defer
// the error until later. libuv mimics this behaviour to provide
// consistent behaviour across platforms but that means we could very
// well have a socket that is not actually bound... that's why we do
// this ghetto port check and raise EADDRINUSE if the requested and the
// actual port differ except if port == 0 because that means "any port".
if (port && port != handle.getsockname().port) {
self.emit('error', errnoException('EADDRINUSE', 'bind'));
return;
}

self._handle = handle;
self._listen2(address, port, addressType);
});
}


This file was deleted.

0 comments on commit 4b8c73a

Please sign in to comment.
You can’t perform that action at this time.