mirror of
https://github.com/rabbibotton/clog.git
synced 2025-12-06 02:30:42 -08:00
Don't recursively reconnect if the server sends a normal close
This commit is contained in:
parent
a05ff40e97
commit
7713d7f02f
1 changed files with 14 additions and 9 deletions
|
|
@ -64,6 +64,10 @@ function Setup_ws() {
|
|||
}
|
||||
|
||||
ws.onclose = function (event) {
|
||||
if (event.code && event.code === 1000) {
|
||||
console.log("WebSocket connection got normal close from server. Don't reconnect.");
|
||||
Shutdown_ws(event);
|
||||
} else {
|
||||
console.log ('onclose: reconnect');
|
||||
ws = null;
|
||||
ws = new WebSocket (adr + '?r=' + clog['connection_id']);
|
||||
|
|
@ -76,6 +80,7 @@ function Setup_ws() {
|
|||
Shutdown_ws(event);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function Open_ws() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue