mirror of
https://github.com/socketio/socket.io.git
synced 2026-04-30 03:00:39 -04:00
Refactored Transport#end
Removed concept of transport pausing as we no longer have async buffers.
This commit is contained in:
@@ -447,35 +447,24 @@ Transport.prototype.onClose = function () {
|
||||
* @api private
|
||||
*/
|
||||
|
||||
Transport.prototype.end = function (forced, reason) {
|
||||
Transport.prototype.end = function (reason) {
|
||||
if (!this.disconnected) {
|
||||
this.log.info('ending socket');
|
||||
|
||||
var local = this.manager.transports[this.id];
|
||||
|
||||
this.close();
|
||||
this.clearTimeouts();
|
||||
|
||||
if (!forced)
|
||||
this.store.disconnect(this.id, false, reason);
|
||||
|
||||
this.disconnected = true;
|
||||
|
||||
if (local) {
|
||||
this.manager.onClientDisconnect(this.id, reason, true);
|
||||
} else {
|
||||
this.store.publish('disconnect:' + this.id, reason);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Signals that the transport can start flushing buffers.
|
||||
*
|
||||
* @api public
|
||||
*/
|
||||
|
||||
Transport.prototype.resume = function () {
|
||||
if (!this.disconnected) {
|
||||
this.paused = false;
|
||||
this.setHeartbeatInterval();
|
||||
this.subscribe();
|
||||
}
|
||||
|
||||
return this;
|
||||
};
|
||||
|
||||
/**
|
||||
* Signals that the transport should pause and buffer data.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user