SmingRTOS
SmingRTOS copied to clipboard
Use tcp_close to destroy the TCP listening socket.
It's an error to call tcp_poll() on a pcb that has been converted to a listening socket via tcp_listen(), with such calls causing memory corruption. Call tcp_close to destroy the socket instead in ~TcpServer, and NULL out tcp to suppress the call to tcp_poll in the base class (via ~TcpConnection()->TcpConnection::close()->tcp_poll()).
@alltheblinkythings : I am looking into your remarks. Tcp_poll is not called by Sming framework, it comes from the LWIP processes. I think you are right on tcp_close() calling in ~TcpServer Will comment further shortly.