diff --git a/client/SignalExchangerClient.js b/client/SignalExchangerClient.js index 62649e5..7eef03b 100644 --- a/client/SignalExchangerClient.js +++ b/client/SignalExchangerClient.js @@ -119,6 +119,15 @@ class SignalExchangerClient { }); } + /** + * Use this method to get the current connection status to the server + * + * @return {Boolean} TRUE if the client is connected to the server / FALSE else + */ + isConnected() { + return this.socket.readyState == WebSocket.OPEN; + } + /** * Method called once the client is successfully * connected to the client diff --git a/video-client/SignalExchangerClient.js b/video-client/SignalExchangerClient.js index 62649e5..7eef03b 100644 --- a/video-client/SignalExchangerClient.js +++ b/video-client/SignalExchangerClient.js @@ -119,6 +119,15 @@ class SignalExchangerClient { }); } + /** + * Use this method to get the current connection status to the server + * + * @return {Boolean} TRUE if the client is connected to the server / FALSE else + */ + isConnected() { + return this.socket.readyState == WebSocket.OPEN; + } + /** * Method called once the client is successfully * connected to the client