I believe that both of these methods in the MQTTNetwork class should be setting the socket timeout based on the timeout passed. They are not.
Current:
int read(unsigned char* buffer, int len, int timeout) {
return socket->recv(buffer, len);
}
int write(unsigned char* buffer, int len, int timeout) {
return socket->send(buffer, len);
}
Proposed Fix:
int read(unsigned char* buffer, int len, int timeout) {
socket->set_timeout(timeout);
return socket->recv(buffer, len);
}
int write(unsigned char* buffer, int len, int timeout) {
socket->set_timeout(timeout);
return socket->send(buffer, len);
}
[ ] Question
[ ] Enhancement
[X] Bug
Internal Jira reference: https://jira.arm.com/browse/MBOCUSTRIA-1514
@JRubis I can't find MQTTNetwork class in Mbed OS?
Hi @AriParkkila, sorry it's in the HelloMQTT example. Maybe this wasn't the right place for me to file a bug against an example versus the core OS?
https://os.mbed.com/teams/mqtt/code/HelloMQTT/file/e38aaf532823/MQTTNetwork.h/
@JRubis Correct, please provide a pull request in the example.
I'll close this issue then.
Most helpful comment
Hi @AriParkkila, sorry it's in the HelloMQTT example. Maybe this wasn't the right place for me to file a bug against an example versus the core OS?
https://os.mbed.com/teams/mqtt/code/HelloMQTT/file/e38aaf532823/MQTTNetwork.h/