Problem when the connection stay open (esp_http_client)

Cupcake
Posts: 4
Joined: Tue Dec 01, 2020 10:05 am

Problem when the connection stay open (esp_http_client)

Postby Cupcake » Mon Aug 30, 2021 2:05 pm

Hi

We have a device using ESP32. This device is connected to a WebSocket server using a WebSocket client. Sometimes it need to use the esp_http_client to get a file from a server.

We found a problem in specific circonstances:

When we are connected to the WebSocket server and we open the esp_http_client and read the begin of a remote file (70 bytes), if the esp_http_client connexion stay open for a long without more reads then at some point (6 or 7 minutes) we loose the websocket connection and the esp32 is not able to reconnect.

With Wiresharks we can see that the esp_http_client connexion received 5744 bytes (size of TCP_WINDOW), but we only read 70 bytes. So the remaining bytes stay in TCP_WINDOW lwip buffer.

We have a lot of "TCP ZERO WINDOW" traces, but it's normal because we don't read bytes coming from the http connexion and they stay in TCP_WINDOW buffer. (this is for the test)

Questions:
- The TCP_WINDOW buffer in LWIP is per sockets or global ?
- Is it a problem to keep data in TCP_WINDOW buffer and not reading it for a while without closing the connexion ? Does it makes troubles in LWiP ?
- Do you have an idea why this esp_http_client connexion freeze the WebSocket connexion ? What can cause this ?

Thanks

Who is online

Users browsing this forum: No registered users and 127 guests