-
Notifications
You must be signed in to change notification settings - Fork 18
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
Exception in MQTTClient #72
Comments
Hard to say what might be going on from the limited information. That exception should never happen in normal operation. My best guess is that the socket disconnected and the driver noticed but the disconnect notification hasn't reached the higher software layer. Does it seem possible that either the server connection or Wi-Fi connection was lost in this case? One solution would be for the MQTT client to catch the exception and close the socket. That will solve the problem for MQTTT but not other users of the TCP socket. A more general solution is to treat the unexpected write failure as notification that the socket connection is lost, fail silently here, and report the error through the usual |
FWIW – reporting via if (ERR_OK != tcp_write_safe(tcp->skt, buffer, needed, TCP_WRITE_FLAG_COPY | TCP_WRITE_FLAG_MORE)) {
xsTrace("tcp write failed");
tcpTrigger(tcp, kTCPError);
return;
} |
There was no indication of any major (in the sense of cable disconnected or other systems had noticed & reported) loss of connection.
My view: Priority should be, to catch the exception. Reporting back via
I know. Unfortunately |
Never seen that. If you have a way to reproduce that, please open an issue.
OK. Networks are unreliable, so seemingly random failures do happen. The non-determinism makes diagnosing these issues challenging. |
Changes committed to SDK TCP implementations for macOS, Linux, and embedded (lwip) targets. Will propagate to public Moddable SDK repository by week's end. |
Done. |
Exception resolved in TCP module. Closing. |
No further debugging possible, no further info available.
The text was updated successfully, but these errors were encountered: