lwip-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[lwip-users] Socket are not correctly closed on disconnection ?


From: Stefano Tebaldi
Subject: [lwip-users] Socket are not correctly closed on disconnection ?
Date: Fri, 16 Sep 2022 01:52:33 +0200

Hello,

On an embedded device running FreeRTOS and LwIP v I am opening a listening socket that creates data socket when accepting connections. When the connection cable is removed (or with wifi if I switch off the access point), I can detect it and call netif_set_link_down. I can see that if I try to send on a socket I get error, but on the receive I am not able to understand that the socket has been closed by LwIP. I then tried to close the socket by the application and it seems that something remains allocated in LwIP since if I try to re-open the listening socket on the reconnection for example, I get bind error address already in use. I noticed that removing the netif with netif_remove() after the disconnection I am able to recreate the socket and everything seems to work again on the reconnection (redoing netif_add).

What can be the problem and how to manage correctly this scenario ?

Thank you




reply via email to

[Prev in Thread] Current Thread [Next in Thread]