mirror of
https://github.com/nvms/prsm.git
synced 2025-12-16 00:00:52 +00:00
add disconnect method for client
This commit is contained in:
parent
24b856b78f
commit
b55d854b8a
@ -97,6 +97,16 @@ export class KeepAliveClient extends EventTarget {
|
||||
}, this.options.pingTimeout + this.options.maxLatency);
|
||||
}
|
||||
|
||||
disconnect() {
|
||||
this.options.shouldReconnect = false;
|
||||
|
||||
if (this.socket) {
|
||||
this.socket.close();
|
||||
}
|
||||
|
||||
clearTimeout(this.pingTimeout);
|
||||
}
|
||||
|
||||
async reconnect() {
|
||||
if (this.isReconnecting) {
|
||||
return;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user