This commit is contained in:
yumoqing 2024-10-09 15:33:17 +08:00
parent f2135c579f
commit dd199f0bc0

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 = function(){ this.socket.onclose = this.init_websocket.bind(this);
this.init_websockset(); this.init_websockset();
}; };
this.socket.onerror = function(){ this.socket.onerror = this.reconnect.bind(this);
}
reconnect(){
try { try {
this.socket.close(); this.socket.close();
} catch(e){ } catch(e){