mirror of
https://github.com/tiramisulabs/seyfert.git
synced 2025-07-01 20:46:08 +00:00
fix: zombie connection
This commit is contained in:
parent
dd8fbd2789
commit
9f54a8df9c
@ -335,9 +335,9 @@ export class Shard {
|
|||||||
async close(code: number, reason: string) {
|
async close(code: number, reason: string) {
|
||||||
clearInterval(this.heart.nodeInterval);
|
clearInterval(this.heart.nodeInterval);
|
||||||
if (!this.isOpen) {
|
if (!this.isOpen) {
|
||||||
return this.debugger?.warn(`[Shard #${this.id}] Is not open`);
|
return this.debugger?.warn(`[Shard #${this.id}] Is not open, reason:`, reason);
|
||||||
}
|
}
|
||||||
this.debugger?.debug(`[Shard #${this.id}] Called close`);
|
this.debugger?.debug(`[Shard #${this.id}] Called close with reason:`, reason);
|
||||||
this.websocket?.close(code, reason);
|
this.websocket?.close(code, reason);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -234,7 +234,10 @@ export class SeyfertWebSocket {
|
|||||||
buffer.write(reason, 2);
|
buffer.write(reason, 2);
|
||||||
// message, close opcode
|
// message, close opcode
|
||||||
this._write(buffer, 0x8);
|
this._write(buffer, 0x8);
|
||||||
|
|
||||||
this.socket?.end();
|
this.socket?.end();
|
||||||
|
|
||||||
|
this.onclose({ code, reason });
|
||||||
}
|
}
|
||||||
|
|
||||||
pong(data: string) {
|
pong(data: string) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user