Skip to content

Commit f48b40e

Browse files
committed
Fix disconnectSync getting ignored
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.
1 parent 1679fd5 commit f48b40e

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

lib/transports/http-polling.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,7 @@ HTTPPolling.prototype.name = 'httppolling';
5151

5252
HTTPPolling.prototype.setHandlers = function () {
5353
HTTPTransport.prototype.setHandlers.call(this);
54-
this.socket.removeListener('end', this.bound.end);
55-
this.socket.removeListener('close', this.bound.close);
54+
this.socket.removeListener('end', this.bound.end);
5655
};
5756

5857
/**

0 commit comments

Comments
 (0)