mirror of
https://github.com/s00500/ESPUI.git
synced 2024-11-22 04:00: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() {
|
function conStatusError() {
|
||||||
|
FragmentAssemblyTimer.forEach(element => {
|
||||||
|
clearInterval(element);
|
||||||
|
});
|
||||||
|
FragmentAssemblyTimer = new Object();
|
||||||
|
controlAssemblyArray = new Object();
|
||||||
|
|
||||||
if (true === websockConnected) {
|
if (true === websockConnected) {
|
||||||
websockConnected = false;
|
websockConnected = false;
|
||||||
websock.close();
|
websock.close();
|
||||||
@ -248,6 +254,11 @@ function start() {
|
|||||||
$("#conStatus").addClass("color-green");
|
$("#conStatus").addClass("color-green");
|
||||||
$("#conStatus").text("Connected");
|
$("#conStatus").text("Connected");
|
||||||
websockConnected = true;
|
websockConnected = true;
|
||||||
|
FragmentAssemblyTimer.forEach(element => {
|
||||||
|
clearInterval(element);
|
||||||
|
});
|
||||||
|
FragmentAssemblyTimer = new Object();
|
||||||
|
controlAssemblyArray = new Object();
|
||||||
};
|
};
|
||||||
|
|
||||||
websock.onclose = function (evt) {
|
websock.onclose = function (evt) {
|
||||||
@ -256,6 +267,11 @@ function start() {
|
|||||||
// console.log("Close code: '" + evt.code + "'");
|
// console.log("Close code: '" + evt.code + "'");
|
||||||
console.log("websock close");
|
console.log("websock close");
|
||||||
conStatusError();
|
conStatusError();
|
||||||
|
FragmentAssemblyTimer.forEach(element => {
|
||||||
|
clearInterval(element);
|
||||||
|
});
|
||||||
|
FragmentAssemblyTimer = new Object();
|
||||||
|
controlAssemblyArray = new Object();
|
||||||
};
|
};
|
||||||
|
|
||||||
websock.onerror = function (evt) {
|
websock.onerror = function (evt) {
|
||||||
@ -264,6 +280,11 @@ function start() {
|
|||||||
// console.log("Error data: '" + evt.data + "'");
|
// console.log("Error data: '" + evt.data + "'");
|
||||||
|
|
||||||
restart();
|
restart();
|
||||||
|
FragmentAssemblyTimer.forEach(element => {
|
||||||
|
clearInterval(element);
|
||||||
|
});
|
||||||
|
FragmentAssemblyTimer = new Object();
|
||||||
|
controlAssemblyArray = new Object();
|
||||||
};
|
};
|
||||||
|
|
||||||
var handleEvent = function (evt) {
|
var handleEvent = function (evt) {
|
||||||
|
Loading…
Reference in New Issue
Block a user