Prevent double emission of disconnect (#968)

This commit is contained in:
HolonProduction
2026-02-03 00:38:21 +01:00
committed by GitHub
parent 97dcac6d98
commit 104148baa9

View File

@@ -51,10 +51,8 @@ export class MessageIO extends EventEmitter {
socket.on("data", (chunk: Buffer) => { socket.on("data", (chunk: Buffer) => {
this.emit("data", chunk); this.emit("data", chunk);
}); });
// socket.on("end", this.on_disconnected.bind(this));
socket.on("error", () => { socket.on("error", () => {
this.socket = null; this.socket = null;
this.emit("disconnected");
}); });
socket.on("close", () => { socket.on("close", () => {
this.socket = null; this.socket = null;