diff --git a/lib/Connection.js b/lib/Connection.js index c6de769..5e8c6b1 100644 --- a/lib/Connection.js +++ b/lib/Connection.js @@ -231,13 +231,15 @@ Connection.prototype.serverSupports = function(cap) { Connection.prototype.destroy = function() { this._queue = []; this._curReq = undefined; - this._sock.end(); + this._sock.destroy(); }; Connection.prototype.end = function() { var self = this; this._enqueue('LOGOUT', function() { - self.destroy(); + self._queue = []; + self._curReq = undefined; + self._sock.end(); }); };