-
Notifications
You must be signed in to change notification settings - Fork 238
Client disconnected when error code is LWMQTT_BUFFER_TOO_SHORT #120
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
Comments
I wrote a work around to reconnect, if the error code was on of the following: But, if let's say internet is not available through the wireless router, a false error code LWMQTT_NETWORK_FAILED_WRITE is reported and a false return code LWMQTT_CONNECTION_ACCEPTED is reported |
On your last comment: I fixed the wrong return code here 4d9e708. Thanks for noticing. The On your first comment:
void messageReceived(MQTTClient *client,
char topic[],
char payload[],
int payload_length,
bool chunked,
int offset,
int total_length) {} If I'm strongly in favor of the last solution as it is the most natural to me. When the "chunked" API has landed in LWMQTT we can easily add another callback signature (as described above) to let the user opt-in if necessary. |
Umm...I guess, yes the error code I was not suggesting supporting C++ streams, but rather a Print class object: like here , although the third solution you suggested is the preferable one. But until then, I guess the switching to disconnected state should not be done on buffer overflow errors. |
Closing this in favor of #145. |
The socket is disconnected when data length greater than the buffer size is received, as a result LWT is published by the broker.
I think, connection should not be closed, and either
The text was updated successfully, but these errors were encountered: