diff --git a/lib/socket.js b/lib/socket.js index 0ec08805..751dab46 100644 --- a/lib/socket.js +++ b/lib/socket.js @@ -334,12 +334,9 @@ Socket.prototype.sendPacket = function (type, data) { Socket.prototype.close = function () { if ('opening' == this.readyState || 'open' == this.readyState) { - if (this.transport) { - // debug: socket closing - telling transport to close - this.transport.close(); - } - - this.onClose(); + this.onClose('forced close'); + // debug: socket closing - telling transport to close + this.transport.close(); } return this;