*Bug fix not closing the WS connection properly
This commit is contained in:
parent
e8f632299b
commit
4104942f07
|
@ -20,7 +20,7 @@ export default class Socket extends Duplex {
|
|||
|
||||
if (event === "message") {
|
||||
sendEvent = "data";
|
||||
sendData[0] = (args[0] as MessageEvent).data + "\n" as any;
|
||||
sendData[0] = ((args[0] as MessageEvent).data + "\n") as any;
|
||||
}
|
||||
// @ts-ignore
|
||||
return this.emit(sendEvent, ...sendData);
|
||||
|
@ -32,6 +32,10 @@ export default class Socket extends Duplex {
|
|||
this._ws.send(data);
|
||||
cb();
|
||||
}
|
||||
_destroy(cb: any) {
|
||||
this._ws.close();
|
||||
cb();
|
||||
}
|
||||
setEncoding() {}
|
||||
}
|
||||
export function connect(
|
||||
|
|
Loading…
Reference in New Issue