Skip to content

Commit 070bec9

Browse files
committed
修复断开socket.io连接时没有关闭socket的bug
1 parent eb450a5 commit 070bec9

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

packages/pinus/lib/connectors/siosocket.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,9 @@ export class SioSocket extends EventEmitter implements ISocket {
5656
}
5757

5858
this.state = ST_CLOSED;
59-
this.socket.disconnect();
59+
this.socket.disconnect(true);
60+
this.socket.removeAllListeners();
61+
this.socket = undefined;
6062
}
6163

6264
sendBatch(msgs: any[]) {

0 commit comments

Comments
 (0)