Skip to content

Commit 383a2ca

Browse files
committed
Reset last RX to mills() after client connect
1 parent 1292b8c commit 383a2ca

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/MqttClient.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -785,7 +785,6 @@ int MqttClient::connect(IPAddress ip, const char* host, uint16_t port)
785785
_rxState = MQTT_CLIENT_RX_STATE_READ_TYPE;
786786
_connected = false;
787787
_txPacketId = 0x0000;
788-
_lastRx = 0;
789788

790789
if (host) {
791790
if (!_client->connect(host, port)) {
@@ -799,6 +798,8 @@ int MqttClient::connect(IPAddress ip, const char* host, uint16_t port)
799798
}
800799
}
801800

801+
_lastRx = millis();
802+
802803
String id = _id;
803804
int idLength = id.length();
804805
int usernameLength = _username.length();

0 commit comments

Comments
 (0)