From 070bec9749f63e4075868668c46a1b095de29685 Mon Sep 17 00:00:00 2001 From: mybios Date: Fri, 13 Dec 2024 22:45:07 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=96=AD=E5=BC=80socket.io?= =?UTF-8?q?=E8=BF=9E=E6=8E=A5=E6=97=B6=E6=B2=A1=E6=9C=89=E5=85=B3=E9=97=AD?= =?UTF-8?q?socket=E7=9A=84bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/pinus/lib/connectors/siosocket.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/pinus/lib/connectors/siosocket.ts b/packages/pinus/lib/connectors/siosocket.ts index 307a4f633..97f587750 100644 --- a/packages/pinus/lib/connectors/siosocket.ts +++ b/packages/pinus/lib/connectors/siosocket.ts @@ -56,7 +56,9 @@ export class SioSocket extends EventEmitter implements ISocket { } this.state = ST_CLOSED; - this.socket.disconnect(); + this.socket.disconnect(true); + this.socket.removeAllListeners(); + this.socket = undefined; } sendBatch(msgs: any[]) {