Fix client send buffer not being sent on ready

Fix WebSocketClientConnector not sending the send buffer queued up
between starting the connection and the master server sending the ready
signal for it.
This commit is contained in:
Hornwitser committed 2020-05-09 16:34:46 +02:00
1 parent 04ee3d3f96
commit 1b427af5f0
1 file changed
+3
+3
View File
@@ -380,6 +380,9 @@ class WebSocketClientConnector extends WebSocketBaseConnector {
this._sessionToken = data.session_token;
this._heartbeatInterval = data.heartbeat_interval;
this.startHeartbeat();
for (let message of this._sendBuffer) {
this._socket.send(JSON.stringify(message));
}
this._startedReconnect = null;
this._connected = true;
this.emit("connect");