mirror of
https://github.com/s00500/ESPUI.git
synced 2024-11-21 22:50:55 +00:00
Added fragment assembly reset if something happens to the socket.
This commit is contained in:
parent
794d54dc96
commit
adf2ba369e
21
data/js/controls.js
vendored
21
data/js/controls.js
vendored
@ -194,6 +194,12 @@ function restart() {
|
||||
}
|
||||
|
||||
function conStatusError() {
|
||||
FragmentAssemblyTimer.forEach(element => {
|
||||
clearInterval(element);
|
||||
});
|
||||
FragmentAssemblyTimer = new Object();
|
||||
controlAssemblyArray = new Object();
|
||||
|
||||
if (true === websockConnected) {
|
||||
websockConnected = false;
|
||||
websock.close();
|
||||
@ -248,6 +254,11 @@ function start() {
|
||||
$("#conStatus").addClass("color-green");
|
||||
$("#conStatus").text("Connected");
|
||||
websockConnected = true;
|
||||
FragmentAssemblyTimer.forEach(element => {
|
||||
clearInterval(element);
|
||||
});
|
||||
FragmentAssemblyTimer = new Object();
|
||||
controlAssemblyArray = new Object();
|
||||
};
|
||||
|
||||
websock.onclose = function (evt) {
|
||||
@ -256,6 +267,11 @@ function start() {
|
||||
// console.log("Close code: '" + evt.code + "'");
|
||||
console.log("websock close");
|
||||
conStatusError();
|
||||
FragmentAssemblyTimer.forEach(element => {
|
||||
clearInterval(element);
|
||||
});
|
||||
FragmentAssemblyTimer = new Object();
|
||||
controlAssemblyArray = new Object();
|
||||
};
|
||||
|
||||
websock.onerror = function (evt) {
|
||||
@ -264,6 +280,11 @@ function start() {
|
||||
// console.log("Error data: '" + evt.data + "'");
|
||||
|
||||
restart();
|
||||
FragmentAssemblyTimer.forEach(element => {
|
||||
clearInterval(element);
|
||||
});
|
||||
FragmentAssemblyTimer = new Object();
|
||||
controlAssemblyArray = new Object();
|
||||
};
|
||||
|
||||
var handleEvent = function (evt) {
|
||||
|
Loading…
Reference in New Issue
Block a user