|
|
|
@ -114,6 +114,7 @@ Connection.prototype.connect = function() {
|
|
|
|
|
socket.once('close', function(had_err) {
|
|
|
|
|
clearTimeout(self._tmrConn);
|
|
|
|
|
clearTimeout(self._tmrKeepalive);
|
|
|
|
|
self.state = 'disconnected';
|
|
|
|
|
self.debug && self.debug('[connection] Closed');
|
|
|
|
|
self.emit('close', had_err);
|
|
|
|
|
});
|
|
|
|
@ -121,6 +122,7 @@ Connection.prototype.connect = function() {
|
|
|
|
|
socket.once('end', function() {
|
|
|
|
|
clearTimeout(self._tmrConn);
|
|
|
|
|
clearTimeout(self._tmrKeepalive);
|
|
|
|
|
self.state = 'disconnected';
|
|
|
|
|
self.debug && self.debug('[connection] Ended');
|
|
|
|
|
self.emit('end');
|
|
|
|
|
});
|
|
|
|
|