We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents e6cac2f + d471121 commit 30880adCopy full SHA for 30880ad
src/PubSubClient.cpp
@@ -370,7 +370,7 @@ uint32_t PubSubClient::readPacket(uint8_t* lengthLength) {
370
boolean PubSubClient::loop() {
371
if (connected()) {
372
unsigned long t = millis();
373
- if ((t - lastInActivity > this->keepAlive*1000UL) || (t - lastOutActivity > this->keepAlive*1000UL)) {
+ if (((t - lastInActivity > this->keepAlive*1000UL) || (t - lastOutActivity > this->keepAlive*1000UL)) && keepAlive != 0) {
374
if (pingOutstanding) {
375
this->_state = MQTT_CONNECTION_TIMEOUT;
376
_client->stop();
0 commit comments