ESP_ERR_HTTP_EAGAIN in http calls
Posted: Wed Apr 03, 2019 1:53 pm
Hi,
I made http calls non blocking by keeping is_async = true in esp_http_client_config_t. To avoid ESP_ERR_HTTP_EAGAIN
error (which we get mostly in making non-blocking calls), I implemented below code in my http call:
while(1){
err = esp_http_client_perform(client);
if(err != ESP_ERR_HTTP_EAGAIN)
break;
}
What is best way to exit from this infinite loop, as when internet is off, it gets struck infinitely in this loop by throwing ESP_ERR_HTTP_EAGAIN even after switching on the internet.
Thanks
Ritu.
I made http calls non blocking by keeping is_async = true in esp_http_client_config_t. To avoid ESP_ERR_HTTP_EAGAIN
error (which we get mostly in making non-blocking calls), I implemented below code in my http call:
while(1){
err = esp_http_client_perform(client);
if(err != ESP_ERR_HTTP_EAGAIN)
break;
}
What is best way to exit from this infinite loop, as when internet is off, it gets struck infinitely in this loop by throwing ESP_ERR_HTTP_EAGAIN even after switching on the internet.
Thanks
Ritu.