Fixed Socket#close and added close reason

This commit is contained in:
Guillermo Rauch
2012-01-03 13:16:07 -08:00
parent 82742c3cb3
commit 3fed6df2af

View File

@@ -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;