mirror of
https://github.com/espressif/esp-mqtt.git
synced 2025-07-29 18:28:24 +02:00
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:
@ -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