mirror of https://github.com/OpenVidu/openvidu.git
openvidu-browser: clean "closeSession" configuration from jsonrpcclient.js
parent
834da536b6
commit
693e2e6583
|
@ -759,7 +759,6 @@ export class OpenVidu {
|
||||||
startWs(onConnectSucces: (error: Error) => void): void {
|
startWs(onConnectSucces: (error: Error) => void): void {
|
||||||
const config = {
|
const config = {
|
||||||
heartbeat: 5000,
|
heartbeat: 5000,
|
||||||
sendCloseMessage: false,
|
|
||||||
ws: {
|
ws: {
|
||||||
uri: this.wsUri,
|
uri: this.wsUri,
|
||||||
onconnected: onConnectSucces,
|
onconnected: onConnectSucces,
|
||||||
|
|
|
@ -33,7 +33,6 @@ var Logger = console;
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* heartbeat: interval in ms for each heartbeat message,
|
* heartbeat: interval in ms for each heartbeat message,
|
||||||
* sendCloseMessage : true / false, before closing the connection, it sends a closeSession message
|
|
||||||
* <pre>
|
* <pre>
|
||||||
* ws : {
|
* ws : {
|
||||||
* uri : URI to conntect to,
|
* uri : URI to conntect to,
|
||||||
|
@ -250,25 +249,13 @@ function JsonRpcClient(configuration) {
|
||||||
|
|
||||||
this.close = function (code, reason) {
|
this.close = function (code, reason) {
|
||||||
Logger.debug("Closing with code: " + code + " because: " + reason);
|
Logger.debug("Closing with code: " + code + " because: " + reason);
|
||||||
|
|
||||||
if (pingInterval != undefined) {
|
if (pingInterval != undefined) {
|
||||||
Logger.debug("Clearing ping interval");
|
Logger.debug("Clearing ping interval");
|
||||||
clearInterval(pingInterval);
|
clearInterval(pingInterval);
|
||||||
}
|
}
|
||||||
pingPongStarted = false;
|
pingPongStarted = false;
|
||||||
enabledPings = false;
|
enabledPings = false;
|
||||||
|
ws.close(code, reason);
|
||||||
if (configuration.sendCloseMessage) {
|
|
||||||
Logger.debug("Sending close message")
|
|
||||||
this.send('closeSession', null, function (error, result) {
|
|
||||||
if (error) {
|
|
||||||
Logger.error("Error sending close message: " + JSON.stringify(error));
|
|
||||||
}
|
|
||||||
ws.close(code, reason);
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
ws.close(code, reason);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// This method is only for testing
|
// This method is only for testing
|
||||||
|
|
Loading…
Reference in New Issue