ensure we don't keep queueing http requests when we're not in the looping state.

This commit is contained in:
pulipakaa24
2026-01-12 16:26:25 -06:00
parent 45fa356d66
commit d21632da8d
4 changed files with 14 additions and 4 deletions

View File

@@ -12,6 +12,7 @@
static esp_socketio_client_handle_t io_client;
static esp_socketio_packet_handle_t tx_packet = NULL;
static bool stopSocketFlag = false;
std::atomic<bool> socketIOactive{false};
// Event handler for Socket.IO events
static void socketio_event_handler(void *handler_args, esp_event_base_t base,
@@ -300,6 +301,8 @@ void initSocketIO() {
esp_socketio_register_events(io_client, SOCKETIO_EVENT_ANY, socketio_event_handler, NULL);
esp_socketio_client_start(io_client);
socketIOactive = true;
}
void stopSocketIO() {
@@ -310,6 +313,7 @@ void stopSocketIO() {
io_client = NULL;
tx_packet = NULL;
}
socketIOactive = false;
}
// Helper function to emit Socket.IO event with data