mirror of
https://gitlab.crans.org/nounous/ghostream.git
synced 2024-12-24 00:52:19 +00:00
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
Block a user