mirror of
https://github.com/socketio/socket.io.git
synced 2026-04-30 03:00:39 -04:00
Fixed Socket#close and added close reason
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user