This commit is contained in:
yumoqing 2024-10-09 15:40:41 +08:00
parent 8d817a4dfc
commit 804d52792a

View File

@ -38,10 +38,12 @@ bricks.Signaling = class {
this.socket = new WebSocket(this.signaling_url); this.socket = new WebSocket(this.signaling_url);
this.socket.onmessage = this.signaling_recvdata.bind(this); this.socket.onmessage = this.signaling_recvdata.bind(this);
this.socket.onopen = this.login.bind(this); this.socket.onopen = this.login.bind(this);
this.socket.onclose = this.init_websocket.bind(this); this.socket.onclose = this.reconnect.bind(this);
this.socket.onerror = this.reconnect.bind(this); this.socket.onerror = this.reconnect.bind(this);
} }
reconnect(){ reconnect(){
console.log('eror happened');
return;
try { try {
this.socket.close(); this.socket.close();
} catch(e){ } catch(e){