mirror of
https://gitlab.com/comunic/nodejs-webrtcsignalexchangerserver
synced 2024-11-21 21:09:27 +00:00
Added a method to check if the socket is connected to the server or not
This commit is contained in:
parent
7318468d49
commit
aae5326bf9
@ -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
|
* Method called once the client is successfully
|
||||||
* connected to the client
|
* connected to the client
|
||||||
|
@ -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
|
* Method called once the client is successfully
|
||||||
* connected to the client
|
* connected to the client
|
||||||
|
Loading…
Reference in New Issue
Block a user