Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Use tcp_close to destroy the TCP listening socket. #148

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

alltheblinkythings
Copy link

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()).

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()).
@hreintke
Copy link
Collaborator

@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.

# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants