I created a code for STM32H743ZI lwip RTOS socket server that can connect multiple clients ,I've an issue in binding of server to socket after terminating and recreating the server thread when ethernet cable is removed and reconnected.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2020-06-15 11:01 PM
Termination of server thread and closing the connection is done in the disconnection of ethernet cable and the thread is recreated when ethernet cable is reconnected, the accepted clients run in separate threads. I am also terminating client handle treads and closing connection of clients when the ethernet cable is removed . the client handling threads are created from the main server thread when a successful accept is happened in server.
- When only server thread is active, when ethernet cable is removed the thread is terminated and connection is closed ,The server thread is recreated when the ethernet cable is reconnected and the binding of server to socket is successful.
- When server thread and client handle threads are active ,When ethernet cable is removed the client handle threads and server thread is terminated and closed all the client connections and server connection , When the ethernet cable is reconnected the server thread is recreated ,But the binding of server to socket is not happening
Why binding of server to socket is not happening in case 2 ?
- Labels:
-
Ethernet
-
STM32H7 Series
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2020-06-20 1:54 AM
You don't have to terminate the server thread and client connections on link disconnection. If the link is restored after a short time, you want the TCP connections to continue to work. They will die off and with timeouts will be closed when the appropriate time will come. Application code doesn't have to deal with link layer code and vice versa.
Anyway, if you are using HAL/Cube code, then the real problem is this:
https://community.st.com/s/question/0D50X0000C6eNNSSQ2/bug-fixes-stm32h7-ethernet
