var debugLevel = 0;
if ('NODE_DEBUG' in process.ENV) debugLevel = 1;
-function debug (x) {
- if (debugLevel > 0) {
- process.stdio.writeError(x + '\n');
- }
+function debug () {
+ if (debugLevel > 0) sys.error.apply(this, arguments);
}
var binding = process.binding('net');
readyStateMessage = 'readyState is depricated. Use stream.readable or stream.writable';
sys.error(readyStateMessage);
}
- if (this.readable && this.writable) {
+ if (this._resolving) {
+ return 'opening';
+ } else if (this.readable && this.writable) {
return 'open';
} else if (this.readable && !this.writable){
return 'readOnly';
self.type = 'tcp';
// TODO dns resolution on arguments[1]
var port = arguments[0];
+ self._resolving = true;
lookupDomainName(arguments[1], function (ip) {
+ self._resolving = false;
doConnect(self, port, ip);
});
} else {