From 8442f3570f10ef28b374b4a9ac674ba2ab57f5c3 Mon Sep 17 00:00:00 2001 From: Phil Kunz Date: Sat, 26 Dec 2020 18:06:22 +0000 Subject: [PATCH] feat(SmartsocketClient): socket client can now be stopped with .stop() addiditionally to .reconnect(), which will still try to re --- ts/smartsocket.classes.smartsocketclient.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/ts/smartsocket.classes.smartsocketclient.ts b/ts/smartsocket.classes.smartsocketclient.ts index e2f64ce..5a910b8 100644 --- a/ts/smartsocket.classes.smartsocketclient.ts +++ b/ts/smartsocket.classes.smartsocketclient.ts @@ -163,6 +163,14 @@ export class SmartsocketClient { } } + /** + * stops the client completely + */ + public async stop() { + this.autoReconnect = false; + await this.disconnect(); + } + /** * try a reconnection */