Browse Source

net: remove unnecessary process.nextTick()

Call internalConnect() directly when the target is an IP address.
No delay is necessary because it defers any callbacks it makes.

PR-URL: https://github.com/nodejs/node/pull/12342
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Evan Lucas <evanlucas@me.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
v6
Ben Noordhuis 8 years ago
parent
commit
571882c5a4
  1. 5
      lib/net.js

5
lib/net.js

@ -991,10 +991,7 @@ function lookupAndConnect(self, options) {
// If host is an IP, skip performing a lookup
var addressType = cares.isIP(host);
if (addressType) {
process.nextTick(function() {
if (self.connecting)
internalConnect(self, host, port, addressType, localAddress, localPort);
});
internalConnect(self, host, port, addressType, localAddress, localPort);
return;
}

Loading…
Cancel
Save