Can we get available number of socket connection out of CONFIG_LWIP_MAX_SOCKETS

akshaay24
Posts: 13
Joined: Wed Jul 14, 2021 5:21 am

Can we get available number of socket connection out of CONFIG_LWIP_MAX_SOCKETS

Postby akshaay24 » Wed Nov 29, 2023 1:18 pm

Hi,

We are using aws mqtt connection, aws jobs connection and one https client connection.
All these connections are initialized, connected and de-initialize as per our use case. We know all these connections happens over socket.

After multiple times connection & disconnection sometimes while connecting to https client it shows below error, after that https client never connect and gives below error while using esp_http_client_perform();

Code: Select all

E (11:27:18.347) TRANSPORT_BASE: Failed to initialize new connection object
E (11:27:18.355) HTTP_CLIENT: Connection failed, sock < 0
E (11:27:18.361) PHY_OTA : HTTP request failed : 28674
So we are considering that we have exhausted all available sockets.

1. Is there any way to determine number of available socket connection?
2. Suppose, if we call disconnect wifi esp_wifi_disconnect(); does it closes all socket connection?

ESP-IDF -> v4.4
CONFIG_LWIP_MAX_SOCKETS = 9

Thanks.
Regards,
Akshay

jlaborda
Posts: 1
Joined: Mon Oct 28, 2024 10:42 am

Re: Can we get available number of socket connection out of CONFIG_LWIP_MAX_SOCKETS

Postby jlaborda » Mon Oct 28, 2024 10:49 am

Any updates on this?

I'm having a simular problem and I'm triying to get the number of used LWIP sockets but could not found the manner.

I'm triying to use getpeername LWIP function to do an scan but don't know what is the exact socketfd descriptor number for TPC sockets on Espressif.

Thanks in advance

Who is online

Users browsing this forum: Baidu [Spider], markkuk and 316 guests