mirror of
				https://github.com/s00500/ESPUI.git
				synced 2025-10-31 12:23:24 +00:00 
			
		
		
		
	Added fragment assembly reset if something happens to the socket.
This commit is contained in:
		
							
								
								
									
										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) { | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 Martin
					Martin