Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

non-blocking sockets become blocking on close() when cable unplugged #16

Open
tabascoeye opened this issue Nov 13, 2014 · 0 comments
Open
Labels

Comments

@tabascoeye
Copy link
Owner

This is because:
lwip_close() -> netconn_delete() -> API_MSG -> do_delconn() -> do_close_internal() -> tcp_close() -> tcp_close_shutdown() -> tcp_send_fin() -> tcp_enqueue_flags()

That last function checks the TCP send queue and returns with ERR_MEM when the cable is unplugged because the send queue is full.
Thus, that error is given up to do_close_internal() which does NOT sys_sem_signal() the op_completed semaphore and in turn, the API_MSG is still being waited on.
Do_close_internal() sets poll_tcp and sent_tcp callbacks which re-call do_close_interal() until it works (when the cable is re-plugged and the send queue can be worked on).

@tabascoeye tabascoeye added the bug label Nov 13, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant