anchao commented on code in PR #12997:
URL: https://github.com/apache/nuttx/pull/12997#discussion_r1721450276


##########
net/tcp/tcp_connect.c:
##########
@@ -359,6 +366,16 @@ int psock_tcp_connect(FAR struct socket *psock,
           ret = psock_setup_callbacks(psock, &state);
           if (ret >= 0)
             {
+              /* Push a cancellation point onto the stack.  This will be
+               * called if the thread is canceled.
+               */
+
+              info.tc_conn = conn;
+              info.tc_cb = state.tc_cb;
+              info.tc_sem = &state.tc_sem;
+              info.tc_free = true;
+              tls_cleanup_push(tls_get_info(), tcp_callback_cleanup, &info);

Review Comment:
   Any socket event should be handled accordingly from `devif_callback_s`. If 
the task is canceled, socket fd should be closed and work queue should be 
canceled.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to