private reconnect, docs for disconnect

This commit is contained in:
nvms 2024-09-03 09:27:43 -04:00
parent d8565d488c
commit 116b4da850

View File

@ -97,6 +97,11 @@ export class KeepAliveClient extends EventTarget {
}, this.options.pingTimeout + this.options.maxLatency); }, this.options.pingTimeout + this.options.maxLatency);
} }
/**
* Disconnect the client from the server.
* The client will not attempt to reconnect.
* To reconnect, create a new KeepAliveClient.
*/
disconnect() { disconnect() {
this.options.shouldReconnect = false; this.options.shouldReconnect = false;
@ -107,7 +112,7 @@ export class KeepAliveClient extends EventTarget {
clearTimeout(this.pingTimeout); clearTimeout(this.pingTimeout);
} }
async reconnect() { private async reconnect() {
if (this.isReconnecting) { if (this.isReconnecting) {
return; return;
} }