*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") {
|
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(
|
||||||
|
|
Loading…
Reference in New Issue