mirror of https://github.com/nodejs/node.git
parent
3aa1975c58
commit
6326b04b07
|
@ -483,6 +483,11 @@ Socket.prototype.connect = function(port /* [host], [cb] */) {
|
||||||
} else if (typeof host == 'string') {
|
} else if (typeof host == 'string') {
|
||||||
debug("connect: find host " + host);
|
debug("connect: find host " + host);
|
||||||
require('dns').lookup(host, function(err, ip, addressType) {
|
require('dns').lookup(host, function(err, ip, addressType) {
|
||||||
|
// It's possible we were destroyed while looking this up.
|
||||||
|
// XXX it would be great if we could cancel the promise returned by
|
||||||
|
// the look up.
|
||||||
|
if (!self._connecting) return;
|
||||||
|
|
||||||
if (err) {
|
if (err) {
|
||||||
// net.createConnection() creates a net.Socket object and
|
// net.createConnection() creates a net.Socket object and
|
||||||
// immediately calls net.Socket.connect() on it (that's us).
|
// immediately calls net.Socket.connect() on it (that's us).
|
||||||
|
|
Loading…
Reference in New Issue