fix reconnecting

This commit is contained in:
Amish Shah
2016-11-28 16:14:34 +00:00
parent b335824570
commit 1933451d2f

View File

@@ -313,7 +313,7 @@ class WebSocketManager extends EventEmitter {
* Tries to reconnect the client, changing the status to Constants.Status.RECONNECTING.
*/
tryReconnect() {
if (this.status === Constants.Status.RECONNECTING) return;
if (this.status === Constants.Status.RECONNECTING || this.status === Constants.Status.CONNECTING) return;
this.status = Constants.Status.RECONNECTING;
this.ws.close();
this.packetManager.handleQueue();