Merge ephemeral_port from lloyd/node-ldapjs
This commit is contained in:
commit
5d91284e57
|
@ -651,7 +651,7 @@ Server.prototype.after = function () {
|
||||||
|
|
||||||
// All these just reexpose the requisite net.Server APIs
|
// All these just reexpose the requisite net.Server APIs
|
||||||
Server.prototype.listen = function (port, host, callback) {
|
Server.prototype.listen = function (port, host, callback) {
|
||||||
if (!port)
|
if (typeof port !== 'number')
|
||||||
throw new TypeError('port (number) required');
|
throw new TypeError('port (number) required');
|
||||||
|
|
||||||
if (typeof (host) === 'function') {
|
if (typeof (host) === 'function') {
|
||||||
|
@ -662,8 +662,8 @@ Server.prototype.listen = function (port, host, callback) {
|
||||||
|
|
||||||
function _callback() {
|
function _callback() {
|
||||||
if (typeof (port) === 'number') {
|
if (typeof (port) === 'number') {
|
||||||
self.host = host;
|
self.host = self.address().address;
|
||||||
self.port = port;
|
self.port = self.address().port;
|
||||||
} else {
|
} else {
|
||||||
self.host = port;
|
self.host = port;
|
||||||
self.port = self.server.fd;
|
self.port = self.server.fd;
|
||||||
|
|
Loading…
Reference in New Issue