Skip to content
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

wrong return value for read timeout in Arduino client #205

Open
ppescher opened this issue Mar 10, 2020 · 0 comments
Open

wrong return value for read timeout in Arduino client #205

ppescher opened this issue Mar 10, 2020 · 0 comments

Comments

@ppescher
Copy link

The return value rc is initialized to -1, which is the value returned when nothing has been received in the specified time frame:
https://github.com/eclipse/paho.mqtt.embedded-c/blob/29ab2aa29c5e47794284376d7f8386cfd54c3eed/MQTTClient/src/arduino/IPStack.h#L48

It may appear to work with faster network links because received data is available quickly, before the client has the chance to check. But it can still fail and it does with slower links or slower server side.

Suggest to replace the above initialization code with rc=0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant