Just a syntactic sugar for doing, for example:
var server = net.createServer(function (c) {
c.end('goodbye, cruel world!\r\n');
server.close().on('close', function () {
console.log('really, goodbye!');
});
}).listen(1337);
Fixes #1922.
s = new Socket();
}
- s.connect(port, arguments[1], arguments[2]);
- return s;
+ return s.connect(port, arguments[1], arguments[2]);
};
/* called when creating new Socket, or when re-using a closed Socket */
debug('connect: missing host');
connect(self, '127.0.0.1', port, 4);
}
+ return self;
};
}
});
}
+ return self;
};
Server.prototype.address = function() {
this._handle.close();
this._handle = null;
this._emitCloseIfDrained();
+
+ return this;
};
Server.prototype._emitCloseIfDrained = function() {