-
Notifications
You must be signed in to change notification settings - Fork 2k
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
doc: add notes that UDP receive functions must be called from same thread #4995
Conversation
@@ -51,6 +51,9 @@ typedef struct conn_udp conn_udp_t; | |||
* @param[in] family The family of @p addr (see @ref net_af). | |||
* @param[in] port The local UDP port for @p conn. | |||
* | |||
* @note @ref conn_udp_recvfrom needs to be called from the same thread as | |||
* for this function. | |||
* |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would rather add these in form of @todo
notes since these are faulty behavior of gnrc_conn_udp
/gnrc_conn_ip
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just mention GNRC in the text. conn
is conceptualized as general connection API. So regardless if other implementations exist or not: this is the current state in GNRC, and not an issue of this API.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And again: I want to strongly advice to use @todo
here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Futhermore, I couldn't find documentation explicitly for gnrc_conn_udp.
there is none. It's just the implementation of this API for GNRC and it should not have different behavior than documented here ;-)
addressed comments |
Maybe mention that this is faulty behavior and needs to be fixed... Otherwise ACK, please squash. |
Both functions must be called from the same thread.
c1f82e2
to
b61b8e9
Compare
addressed comments and squashed |
doc: add notes that UDP receive functions must be called from same thread
Oh! I did not know this. What happens if you use different threads? I'm pretty sure I have a different thread for sending and receiving. Maybe that explains some of my bugs. EDIT: sorry, this is just for connection oriented udp. Apologies for the noise |
Well, the problem with gnrc_conn_udp() or the corresponding socket layer adaption is that the create function (conn_udp) respectively the sending function (POSIX) registers the thread at netreg. This means that only this thread will receive IPC messages, when a UDP datagram for the matching address and port (socket) is received. Otherwise these messages will get dropped. |
fixes #4993.