From 116b4da85004991ea3fbaafe32e606d39447e79b Mon Sep 17 00:00:00 2001 From: nvms Date: Tue, 3 Sep 2024 09:27:43 -0400 Subject: [PATCH] private reconnect, docs for disconnect --- packages/keepalive-ws/src/client/client.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/packages/keepalive-ws/src/client/client.ts b/packages/keepalive-ws/src/client/client.ts index b067073..3bbbc2f 100644 --- a/packages/keepalive-ws/src/client/client.ts +++ b/packages/keepalive-ws/src/client/client.ts @@ -97,6 +97,11 @@ export class KeepAliveClient extends EventTarget { }, 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() { this.options.shouldReconnect = false; @@ -107,7 +112,7 @@ export class KeepAliveClient extends EventTarget { clearTimeout(this.pingTimeout); } - async reconnect() { + private async reconnect() { if (this.isReconnecting) { return; }