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.
Why binding of server to socket is not happening in case 2 ?
2020-06-20 01: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