Refactored Transport#end

Removed concept of transport pausing as we no longer have async buffers.
This commit is contained in:
Guillermo Rauch
2011-06-27 15:46:43 -03:00
parent 7bfcf54f90
commit f736302b97

View File

@@ -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.
*