allow binding ldap server on an ephemeral port

This commit is contained in:
Lloyd Hilaiel 2013-05-27 14:49:44 -06:00
parent 4097a777e9
commit 04eab4716c
1 changed files with 3 additions and 3 deletions

View File

@ -651,7 +651,7 @@ Server.prototype.after = function () {
// All these just reexpose the requisite net.Server APIs
Server.prototype.listen = function (port, host, callback) {
if (!port)
if (typeof port !== 'number')
throw new TypeError('port (number) required');
if (typeof (host) === 'function') {
@ -662,8 +662,8 @@ Server.prototype.listen = function (port, host, callback) {
function _callback() {
if (typeof (port) === 'number') {
self.host = host;
self.port = port;
self.host = self.address().address;
self.port = self.address().port;
} else {
self.host = port;
self.port = self.server.fd;