mirror of
https://gitlab.crans.org/nounous/ghostream.git
synced 2024-12-24 16:02:20 +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) {
|
sendDescription(localDescription, stream, quality) {
|
||||||
if (this.socket.readyState !== 1) {
|
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;
|
return;
|
||||||
}
|
}
|
||||||
this.socket.send(JSON.stringify({
|
this.socket.send(JSON.stringify({
|
||||||
|
Loading…
Reference in New Issue
Block a user