mirror of
https://github.com/tiramisulabs/seyfert.git
synced 2025-07-05 14:36:09 +00:00
fix(socket): use socket.writable to check if its safe to send a message
This commit is contained in:
parent
9b2393f001
commit
3fb57ccc79
@ -177,6 +177,8 @@ export class SeyfertWebSocket {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private _write(buffer: Buffer, opcode: number) {
|
private _write(buffer: Buffer, opcode: number) {
|
||||||
|
if (!this.socket?.writable)
|
||||||
|
return;
|
||||||
const length = buffer.length;
|
const length = buffer.length;
|
||||||
let frame;
|
let frame;
|
||||||
// Kinda same logic as above, but client-side
|
// Kinda same logic as above, but client-side
|
||||||
|
Loading…
x
Reference in New Issue
Block a user