mirror of
https://github.com/nvms/prsm.git
synced 2025-12-16 08:00:53 +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);
|
}, this.options.pingTimeout + this.options.maxLatency);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
disconnect() {
|
||||||
|
this.options.shouldReconnect = false;
|
||||||
|
|
||||||
|
if (this.socket) {
|
||||||
|
this.socket.close();
|
||||||
|
}
|
||||||
|
|
||||||
|
clearTimeout(this.pingTimeout);
|
||||||
|
}
|
||||||
|
|
||||||
async reconnect() {
|
async reconnect() {
|
||||||
if (this.isReconnecting) {
|
if (this.isReconnecting) {
|
||||||
return;
|
return;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user