mirror of https://github.com/OpenVidu/openvidu.git
Correctly handle error on connection
parent
b7a36700f9
commit
4c94412439
|
@ -858,13 +858,14 @@ export class OpenVidu {
|
||||||
/**
|
/**
|
||||||
* @hidden
|
* @hidden
|
||||||
*/
|
*/
|
||||||
startWs(onConnectSucces: (error: Error) => void): void {
|
startWs(onConnectOrError: (error: Error) => void): void {
|
||||||
const config = {
|
const config = {
|
||||||
heartbeat: 5000,
|
heartbeat: 5000,
|
||||||
sendCloseMessage: false,
|
sendCloseMessage: false,
|
||||||
ws: {
|
ws: {
|
||||||
uri: this.wsUri,
|
uri: this.wsUri,
|
||||||
onconnected: onConnectSucces,
|
onconnected: onConnectOrError,
|
||||||
|
onerror: onConnectOrError,
|
||||||
ondisconnect: this.disconnectCallback.bind(this),
|
ondisconnect: this.disconnectCallback.bind(this),
|
||||||
onreconnecting: this.reconnectingCallback.bind(this),
|
onreconnecting: this.reconnectingCallback.bind(this),
|
||||||
onreconnected: this.reconnectedCallback.bind(this)
|
onreconnected: this.reconnectedCallback.bind(this)
|
||||||
|
|
Loading…
Reference in New Issue