-
Notifications
You must be signed in to change notification settings - Fork 549
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Can we describe the behavior of disconnect/autoreconnect and according action #863
Comments
Hi,
the call stack look like this: arduinoWebSockets/src/WebSocketsClient.h Lines 162 to 166 in 30d5e13
arduinoWebSockets/src/WebSocketsClient.cpp Lines 467 to 469 in 30d5e13
arduinoWebSockets/src/WebSockets.cpp Line 468 in 30d5e13
arduinoWebSockets/src/WebSockets.cpp Lines 462 to 465 in 30d5e13
arduinoWebSockets/src/WebSockets.cpp Line 341 in 30d5e13
arduinoWebSockets/src/WebSocketsClient.cpp Line 558 in 30d5e13
arduinoWebSockets/src/WebSocketsClient.cpp Line 202 in 30d5e13
|
Alright, I'll work on some documentation. I'll also link issues here as long as I find some. I'll write in doc for now that this is safe to just call Also, the user can implement queuing on its own if desired. Here is my current implementation of sending, which just skip with a message printed. void serializeAndSend(WebSocketsClient &webSocket, const JsonDocument &document)
{
// Serialize the JSON document to a String
String jsonString;
serializeJson(document, jsonString);
// Send the JSON message to the WebSocket server
#ifdef DEBUG
const bool isSent = webSocket.sendTXT(jsonString);
Serial.print("📥 OUT - ");
if (isSent)
Serial.println(jsonString);
else
Serial.println("Not connected… Skipped!");
#else
webSocket.sendTXT(jsonString);
#endif
} |
Hi,
I would be pleased to improve the documentation on various points about connection stability if you could anyone help me with the investigation.
Once the first authentication has been done we set
autoReconnectInterval
which is by default 500ms.1 - What happens if we use
webSocket.sendTXT
if the client is disconnected? Does it crash, enqueue, ignore ?It seems that it returns
false
nothing gets queued, but there is no crash. Is that right?arduinoWebSockets/src/WebSocketsClient.cpp
Lines 303 to 311 in 30d5e13
2 - is
webSocket.onEvent
called bywebSocket.loop
and therefore it's blocking the loop while loadingThe text was updated successfully, but these errors were encountered: