Merge pull request #472 from apicquot/master
Add yield to resolve connection failures
This commit is contained in:
commit
2bcd9b074a
@ -222,6 +222,7 @@ boolean PubSubClient::connect(const char *id, const char *user, const char *pass
|
||||
boolean PubSubClient::readByte(uint8_t * result) {
|
||||
uint32_t previousMillis = millis();
|
||||
while(!_client->available()) {
|
||||
yield();
|
||||
uint32_t currentMillis = millis();
|
||||
if(currentMillis - previousMillis >= ((int32_t) MQTT_SOCKET_TIMEOUT * 1000)){
|
||||
return false;
|
||||
|
Loading…
x
Reference in New Issue
Block a user