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();
|
let msgStr = msg.toString();
|
||||||
debug("WebSocket", "reveived:", msgStr);
|
debug("WebSocket", "reveived:", msgStr);
|
||||||
let json = JSON.parse(msgStr) as { act: string, id: number, data: any };
|
let json = JSON.parse(msgStr) as { act: string, id: number, data: any };
|
||||||
if (closed) {
|
if (!this.open) {
|
||||||
socket.send(JSON.stringify({
|
socket.send(JSON.stringify({
|
||||||
id: json.id,
|
id: json.id,
|
||||||
state: "error",
|
state: "error",
|
||||||
|
@ -131,6 +131,7 @@ export class wsClient {
|
||||||
});
|
});
|
||||||
|
|
||||||
socket.on('close', () => {
|
socket.on('close', () => {
|
||||||
|
this.open = false;
|
||||||
var i = clients.indexOf(this);
|
var i = clients.indexOf(this);
|
||||||
delete clients[i];
|
delete clients[i];
|
||||||
if (i >= 0) {
|
if (i >= 0) {
|
||||||
|
|
Loading…
Reference in a new issue