Skip to content

Commit

Permalink
sdk/nodejs: fully cleanup client when socket ends
Browse files Browse the repository at this point in the history
  • Loading branch information
lithdew committed Jun 15, 2020
1 parent f27dfd9 commit 7e98524
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions nodejs/src/flatend.ts
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,8 @@ export class Node {
client = new Client(await MonteSocket.connect({host: host, port: port}));

client.sock.once('end', () => {
client?.services?.forEach(service => this.#services.get(service)?.delete(client!));
this.#providers.delete(client!.sock);
this.#clients.delete(addr);

const reconnect = async () => {
Expand Down

0 comments on commit 7e98524

Please sign in to comment.