mirror of https://github.com/OpenVidu/openvidu.git
openvidu-browser: close WebSocket with code and reason
parent
c8597b450e
commit
18c7e5d524
|
@ -102,7 +102,7 @@ function WebSocketWithReconnection(config) {
|
||||||
|
|
||||||
function reconnectAux(maxRetries, numRetries) {
|
function reconnectAux(maxRetries, numRetries) {
|
||||||
Logger.debug("Reconnection attempt #" + numRetries);
|
Logger.debug("Reconnection attempt #" + numRetries);
|
||||||
ws.close();
|
ws.close(4104, 'Connection closed for reconnection');
|
||||||
ws = new WebSocket(wsUri);
|
ws = new WebSocket(wsUri);
|
||||||
|
|
||||||
ws.onopen = () => {
|
ws.onopen = () => {
|
||||||
|
@ -131,13 +131,9 @@ function WebSocketWithReconnection(config) {
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
this.close = () => {
|
this.close = (code, reason) => {
|
||||||
closing = true;
|
closing = true;
|
||||||
ws.close();
|
ws.close(code, reason);
|
||||||
};
|
|
||||||
|
|
||||||
this.forceClose = () => {
|
|
||||||
ws.close();
|
|
||||||
};
|
};
|
||||||
|
|
||||||
this.reconnectWs = () => {
|
this.reconnectWs = () => {
|
||||||
|
|
Loading…
Reference in New Issue