Avoid further wait period after reconnect timeout occurs
When reconnect timer expires an additional waiting period of half the timeout period is seen. Skip this extra waiting period when timeout is detected and perform the connect attempt right away. This change makes configured reconnect timeout value MQTT_RECONNECT_TIMEOUT_MS accurate.
This commit is contained in:
1 parent
f9abda0ddd
commit
17fd713bce
1 file changed
+1
@@ -845,6 +845,7 @@ static void esp_mqtt_task(void *pv)
|
||||
client->state = MQTT_STATE_INIT;
|
||||
client->reconnect_tick = platform_tick_get_ms();
|
||||
ESP_LOGD(TAG, "Reconnecting...");
|
||||
break;
|
||||
}
|
||||
vTaskDelay(client->wait_timeout_ms / 2 / portTICK_RATE_MS);
|
||||
break;
|
||||
|
||||
Reference in new issue
Block a user