fix: don't process socket.connect() if we are already re-connecting (#577)

This commit is contained in:
Kushtrim Pacaj
2020-12-10 11:47:20 +01:00
committed by GitHub
parent 91c0a85c0f
commit 54b73114d1
2 changed files with 5 additions and 1 deletions

View File

@@ -191,6 +191,10 @@ public class Manager extends Emitter {
return this;
}
public boolean isReconnecting() {
return reconnecting;
}
public int reconnectionAttempts() {
return this._reconnectionAttempts;
}

View File

@@ -136,7 +136,7 @@ public class Socket extends Emitter {
EventThread.exec(new Runnable() {
@Override
public void run() {
if (Socket.this.connected) return;
if (Socket.this.connected || Socket.this.io.isReconnecting()) return;
Socket.this.subEvents();
Socket.this.io.open(); // ensure open