Applied a default to config.socketTimeout, renamed error name to something more specific, added space for style

fork
Tony Mobily 10 years ago
parent 15f03a4cb4
commit b98b9e3997

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

Loading…
Cancel
Save