From 693e2e65836c1fda9a26d0891c0db1f5f074e87f Mon Sep 17 00:00:00 2001 From: pabloFuente Date: Thu, 17 Sep 2020 16:50:41 +0200 Subject: [PATCH] openvidu-browser: clean "closeSession" configuration from jsonrpcclient.js --- openvidu-browser/src/OpenVidu/OpenVidu.ts | 1 - .../kurento-jsonrpc/clients/jsonrpcclient.js | 15 +-------------- 2 files changed, 1 insertion(+), 15 deletions(-) diff --git a/openvidu-browser/src/OpenVidu/OpenVidu.ts b/openvidu-browser/src/OpenVidu/OpenVidu.ts index 312bd7f7..6a7bb76b 100644 --- a/openvidu-browser/src/OpenVidu/OpenVidu.ts +++ b/openvidu-browser/src/OpenVidu/OpenVidu.ts @@ -759,7 +759,6 @@ export class OpenVidu { startWs(onConnectSucces: (error: Error) => void): void { const config = { heartbeat: 5000, - sendCloseMessage: false, ws: { uri: this.wsUri, onconnected: onConnectSucces, diff --git a/openvidu-browser/src/OpenViduInternal/KurentoUtils/kurento-jsonrpc/clients/jsonrpcclient.js b/openvidu-browser/src/OpenViduInternal/KurentoUtils/kurento-jsonrpc/clients/jsonrpcclient.js index c4a5b7a8..bf7257c2 100644 --- a/openvidu-browser/src/OpenViduInternal/KurentoUtils/kurento-jsonrpc/clients/jsonrpcclient.js +++ b/openvidu-browser/src/OpenViduInternal/KurentoUtils/kurento-jsonrpc/clients/jsonrpcclient.js @@ -33,7 +33,6 @@ var Logger = console; /** * * heartbeat: interval in ms for each heartbeat message, - * sendCloseMessage : true / false, before closing the connection, it sends a closeSession message *
  * ws : {
  * 	uri : URI to conntect to,
@@ -250,25 +249,13 @@ function JsonRpcClient(configuration) {
 
     this.close = function (code, reason) {
         Logger.debug("Closing  with code: " + code + " because: " + reason);
-
         if (pingInterval != undefined) {
             Logger.debug("Clearing ping interval");
             clearInterval(pingInterval);
         }
         pingPongStarted = false;
         enabledPings = false;
-
-        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);
-        }
+        ws.close(code, reason);
     }
 
     // This method is only for testing