You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I think there's a bug in socket.io 0.9.10 lib/manager.js and sending the connect packet on the second transport after the first fails. E.g. if websocket fails to connect for some reason, then xhr-polling will not have the connect packet sent from server to browser since the server only sends it on the first transport for the same session-id. The patch that seems to fix it is
Btw a simple way to get websocket to fail so the next transport is tried is to skip sending the connect packet, e.g. like this in lib/manager.js:
// echo back connect packet and fire connection event
if (i === '') {
+if (transport.transport!='websocket')
this.namespaces[i].handlePacket(data.id, { type: 'connect' });
}
I think there's a bug in socket.io 0.9.10 lib/manager.js and sending the connect packet on the second transport after the first fails. E.g. if websocket fails to connect for some reason, then xhr-polling will not have the connect packet sent from server to browser since the server only sends it on the first transport for the same session-id. The patch that seems to fix it is
@@ -666,6 +666,7 @@
return;
}
if (handshaken) {
+var t0 = this.transports[data.id];
if (transport.open) {
if (this.closed[data.id] && this.closed[data.id].length) {
transport.payload(this.closed[data.id]);
@@ -706,6 +709,21 @@
self.onClientDisconnect(data.id, reason);
});
}
+else // matches "if (!this.connected[data.id])"
+{
+var t1 = transport;
} else {
if (transport.open) {
transport.error('client not handshaken', 'reconnect');
The text was updated successfully, but these errors were encountered: