Retry message sending when websocket not ready
This commit is contained in:
parent
0f4c57bcde
commit
24478bdc7a
|
@ -39,7 +39,8 @@ export class GsWebSocket {
|
|||
*/
|
||||
sendDescription(localDescription, stream, quality) {
|
||||
if (this.socket.readyState !== 1) {
|
||||
console.log("WebSocket not ready to send data");
|
||||
console.log("Waiting for WebSocket to send data...");
|
||||
setTimeout(() => this.sendDescription(localDescription, stream, quality), 100);
|
||||
return;
|
||||
}
|
||||
this.socket.send(JSON.stringify({
|
||||
|
|
Loading…
Reference in New Issue