Skip to content

client .connect() blocks if wifi is offline, or server is offline/uncontactable. #174

Description

@Bevanj86

I have 4x WS client instances (arduinoWebSockets.h) & 1 WS server instance (ESPAsyncWebServer.h) running on an ESP32. If any of the servers go offline and are uncontactable, evaluating and attempting to reconnect with the following causes major processing blocks :

if(!client1.available()){
client1 = WebsocketsClient();
client1.onMessage(onMessageCallback1);
client1.onEvent(onEventsCallback1);
client1.connect(websockets1_server_host, websockets_server_port, "/ws");
}

With the server offline or uncontactable, this causes a significant block with each loop iteration. If I have a watchdog on, it triggers a reset.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions