mirror of
https://github.com/socketio/socket.io.git
synced 2026-04-30 03:00:39 -04:00
Implemented Polling#doClose
This commit is contained in:
@@ -203,11 +203,23 @@ Polling.prototype.write = function (data) {
|
||||
};
|
||||
|
||||
/**
|
||||
* Writes a payload of messages
|
||||
* Closes the transport.
|
||||
*
|
||||
* @api private
|
||||
*/
|
||||
|
||||
HTTPTransport.prototype.payload = function (msgs) {
|
||||
this.write(parser.encodePayload(msgs));
|
||||
Polling.prototype.doClose = function () {
|
||||
if (this.dataReq) {
|
||||
debug('aborting ongoing data request');
|
||||
this.dataReq.abort();
|
||||
}
|
||||
|
||||
if (this.req) {
|
||||
debug('cleaning up ongoing poll');
|
||||
this.send({ type: 'close' });
|
||||
} else {
|
||||
// upon next poll an error 500 will be emitted
|
||||
// which is effective at signaling the close
|
||||
debug('closed polling but no open request - next poll should err');
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user