*Bug fix not closing the WS connection properly

This commit is contained in:
Derrick Hammer 2023-01-18 04:57:23 -05:00
parent e8f632299b
commit 4104942f07
Signed by: pcfreak30
GPG Key ID: C997C339BE476FF2
1 changed files with 5 additions and 1 deletions

View File

@ -20,7 +20,7 @@ export default class Socket extends Duplex {
if (event === "message") { if (event === "message") {
sendEvent = "data"; sendEvent = "data";
sendData[0] = (args[0] as MessageEvent).data + "\n" as any; sendData[0] = ((args[0] as MessageEvent).data + "\n") as any;
} }
// @ts-ignore // @ts-ignore
return this.emit(sendEvent, ...sendData); return this.emit(sendEvent, ...sendData);
@ -32,6 +32,10 @@ export default class Socket extends Duplex {
this._ws.send(data); this._ws.send(data);
cb(); cb();
} }
_destroy(cb: any) {
this._ws.close();
cb();
}
setEncoding() {} setEncoding() {}
} }
export function connect( export function connect(