Can close connection to signaling server

This commit is contained in:
Pierre HUBERT 2019-01-25 15:13:47 +01:00
parent a98b7e5407
commit b12a28c4d0
2 changed files with 16 additions and 0 deletions

View File

@ -128,6 +128,14 @@ class SignalExchangerClient {
return this.socket.readyState == WebSocket.OPEN; 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 * Method called once the client is successfully
* connected to the client * connected to the client

View File

@ -128,6 +128,14 @@ class SignalExchangerClient {
return this.socket.readyState == WebSocket.OPEN; 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 * Method called once the client is successfully
* connected to the client * connected to the client