From b12a28c4d07b569c68dc82ab7d98f5b05be92b27 Mon Sep 17 00:00:00 2001 From: Pierre HUBERT Date: Fri, 25 Jan 2019 15:13:47 +0100 Subject: [PATCH] Can close connection to signaling server --- client/SignalExchangerClient.js | 8 ++++++++ video-client/SignalExchangerClient.js | 8 ++++++++ 2 files changed, 16 insertions(+) diff --git a/client/SignalExchangerClient.js b/client/SignalExchangerClient.js index 7eef03b..8a4b413 100644 --- a/client/SignalExchangerClient.js +++ b/client/SignalExchangerClient.js @@ -128,6 +128,14 @@ class SignalExchangerClient { return this.socket.readyState == WebSocket.OPEN; } + /** + * Close the connection to the server (if connected) + */ + close() { + if(this.isConnected()) + this.socket.close(); + } + /** * Method called once the client is successfully * connected to the client diff --git a/video-client/SignalExchangerClient.js b/video-client/SignalExchangerClient.js index 7eef03b..8a4b413 100644 --- a/video-client/SignalExchangerClient.js +++ b/video-client/SignalExchangerClient.js @@ -128,6 +128,14 @@ class SignalExchangerClient { return this.socket.readyState == WebSocket.OPEN; } + /** + * Close the connection to the server (if connected) + */ + close() { + if(this.isConnected()) + this.socket.close(); + } + /** * Method called once the client is successfully * connected to the client