use connect() instead of createConnection() as the tls api does not have createConnection
This commit is contained in:
parent
829c481d27
commit
e378ae8474
|
@ -728,9 +728,9 @@ Client.prototype._connect = function _connect() {
|
||||||
self.emit('connect', socket);
|
self.emit('connect', socket);
|
||||||
}
|
}
|
||||||
|
|
||||||
socket = proto.createConnection((this.port || this.socketPath),
|
socket = proto.connect((this.port || this.socketPath),
|
||||||
(this.host ? this.host : onConnect),
|
(this.host ? this.host : onConnect),
|
||||||
(this.host ? onConnect : undefined));
|
(this.host ? onConnect : undefined));
|
||||||
|
|
||||||
setupSocket(socket, this);
|
setupSocket(socket, this);
|
||||||
|
|
||||||
|
|
|
@ -41,7 +41,7 @@ function createPool(options) {
|
||||||
max: options.maxConnections,
|
max: options.maxConnections,
|
||||||
maxIdleTime: options.maxIdleTime,
|
maxIdleTime: options.maxIdleTime,
|
||||||
|
|
||||||
create: function createConnection(callback) {
|
create: function createClient(callback) {
|
||||||
var client = new Client(options);
|
var client = new Client(options);
|
||||||
|
|
||||||
client.once('error', function (err) {
|
client.once('error', function (err) {
|
||||||
|
|
|
@ -132,12 +132,12 @@ test('setup', function (t) {
|
||||||
client = ldap.createClient({
|
client = ldap.createClient({
|
||||||
socketPath: SOCKET,
|
socketPath: SOCKET,
|
||||||
maxConnections: process.env.LDAP_MAX_CONNS || 5,
|
maxConnections: process.env.LDAP_MAX_CONNS || 5,
|
||||||
|
idleTimeoutMillis: 10,
|
||||||
log: new Logger({
|
log: new Logger({
|
||||||
name: 'ldapjs_unit_test',
|
name: 'ldapjs_unit_test',
|
||||||
stream: process.stderr,
|
stream: process.stderr,
|
||||||
level: (process.env.LOG_LEVEL || 'info'),
|
level: (process.env.LOG_LEVEL || 'info'),
|
||||||
serializers: Logger.stdSerializers,
|
serializers: Logger.stdSerializers
|
||||||
idleTimeoutMillis: 10
|
|
||||||
})
|
})
|
||||||
});
|
});
|
||||||
t.ok(client);
|
t.ok(client);
|
||||||
|
|
Loading…
Reference in New Issue