eclipse / paho.mqtt.embedded-c

Paho MQTT C client library for embedded systems. Paho is an Eclipse IoT project (https://iot.eclipse.org/)

Home Page:https://eclipse.org/paho

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

wrong return value for read timeout in Arduino client

ppescher opened this issue · comments

The return value rc is initialized to -1, which is the value returned when nothing has been received in the specified time frame:

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.