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