update
This commit is contained in:
@ -193,7 +193,10 @@ export class ConnectionManager extends EventEmitter {
|
||||
reject(new Error(`Connection timeout after ${timeout}ms`));
|
||||
}, timeout);
|
||||
|
||||
socket.once('connect', () => {
|
||||
// For TLS connections, we need to wait for 'secureConnect' instead of 'connect'
|
||||
const successEvent = this.options.secure ? 'secureConnect' : 'connect';
|
||||
|
||||
socket.once(successEvent, () => {
|
||||
clearTimeout(timeoutHandler);
|
||||
resolve(socket);
|
||||
});
|
||||
|
Reference in New Issue
Block a user