bug fix
This commit is contained in:
parent
083bec3d30
commit
2671dda661
1 changed files with 2 additions and 1 deletions
|
@ -38,7 +38,7 @@ export class wsClient {
|
|||
let msgStr = msg.toString();
|
||||
debug("WebSocket", "reveived:", msgStr);
|
||||
let json = JSON.parse(msgStr) as { act: string, id: number, data: any };
|
||||
if (closed) {
|
||||
if (!this.open) {
|
||||
socket.send(JSON.stringify({
|
||||
id: json.id,
|
||||
state: "error",
|
||||
|
@ -131,6 +131,7 @@ export class wsClient {
|
|||
});
|
||||
|
||||
socket.on('close', () => {
|
||||
this.open = false;
|
||||
var i = clients.indexOf(this);
|
||||
delete clients[i];
|
||||
if (i >= 0) {
|
||||
|
|
Loading…
Reference in a new issue