|
|
@ -56,7 +56,7 @@ function Connection(config) {
|
|
|
|
|
|
|
|
|
|
|
|
this._config = {
|
|
|
|
this._config = {
|
|
|
|
socket: config.socket,
|
|
|
|
socket: config.socket,
|
|
|
|
socketTimeout: config.socketTimeout,
|
|
|
|
socketTimeout: config.socketTimeout || 0,
|
|
|
|
host: config.host || 'localhost',
|
|
|
|
host: config.host || 'localhost',
|
|
|
|
port: config.port || 143,
|
|
|
|
port: config.port || 143,
|
|
|
|
tls: config.tls,
|
|
|
|
tls: config.tls,
|
|
|
@ -158,7 +158,7 @@ Connection.prototype.connect = function() {
|
|
|
|
self.debug && self.debug('[connection] Socket timeout');
|
|
|
|
self.debug && self.debug('[connection] Socket timeout');
|
|
|
|
|
|
|
|
|
|
|
|
var err = new Error('Socket timed out while talking to server');
|
|
|
|
var err = new Error('Socket timed out while talking to server');
|
|
|
|
err.source = 'timeout';
|
|
|
|
err.source = 'socket-timeout';
|
|
|
|
self.emit('error', err);
|
|
|
|
self.emit('error', err);
|
|
|
|
socket.destroy();
|
|
|
|
socket.destroy();
|
|
|
|
};
|
|
|
|
};
|
|
|
|