Attempt WebSocket reconnect on disconnect or keep-alive death
Signed-off-by: James Ketrenos <james_eikona@ketrenos.com>
This commit is contained in:
parent
69de42f644
commit
7439eaf21f
@ -865,7 +865,14 @@ class Table extends React.Component {
|
|||||||
}
|
}
|
||||||
this.keepAlive = setTimeout(() => {
|
this.keepAlive = setTimeout(() => {
|
||||||
console.error(`No server ping for 5 seconds!`);
|
console.error(`No server ping for 5 seconds!`);
|
||||||
|
this.ws.close();
|
||||||
this.setState({ noNetwork: true });
|
this.setState({ noNetwork: true });
|
||||||
|
if (!this.websocketReconnect) {
|
||||||
|
this.websocketReconnect = setTimeout(() => {
|
||||||
|
delete this.websocketReconnect;
|
||||||
|
this.connectWebSocket();
|
||||||
|
}, 1000);
|
||||||
|
}
|
||||||
}, 5000);
|
}, 5000);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user