Links2004 / arduinoWebSockets

arduinoWebSockets
GNU Lesser General Public License v2.1
1.89k stars 556 forks source link

Is it possible to check webSocketEvent when program is busy in a function? #349

Open williamesp2015 opened 6 years ago

williamesp2015 commented 6 years ago

I am using ESP32 and Websocketserver. When CPU is calling a function and is busy for few minutes can not check websocket Events even if call webSocket.loop(); periodically. Any trick ?

Links2004 commented 6 years ago

the sync version will handle data on the webSocket.loop() call, no other way here. for the ESP8266 we have a async version which can interrupt running functions, but since not all async stuff is ported to the ESP32 this will not run there.

so for the ESP32 your best change is to call the webSocket.loop(); inside the function that is blocking the CPU for minutes.