Skip to content

Commit

Permalink
Fix disconnectSync getting ignored
Browse files Browse the repository at this point in the history
If using xhr-polling and a browser closes a tab or window, the
disconnectSync in the socket.io-client method is called which sends an
XHR request to the server indicating a disconnect. This line would cause
that to be ignored and so the server would have to wait for a timeout to
mark them as disconnect. This was possibly because it was sent from a
different tcp socket than the current connection.
  • Loading branch information
crickeys committed Jul 27, 2012
1 parent 1679fd5 commit f48b40e
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions lib/transports/http-polling.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,7 @@ HTTPPolling.prototype.name = 'httppolling';

HTTPPolling.prototype.setHandlers = function () {
HTTPTransport.prototype.setHandlers.call(this);
this.socket.removeListener('end', this.bound.end);
this.socket.removeListener('close', this.bound.close);
this.socket.removeListener('end', this.bound.end);
};

/**
Expand Down

0 comments on commit f48b40e

Please sign in to comment.