[riot-notifications] [RIOT-OS/RIOT] sock/async: add function to retrieve session object of current DTLS event (#15755)

Martine Lenders notifications at github.com
Thu Jan 14 01:46:10 CET 2021

@miri64 commented on this pull request.

> @@ -87,6 +87,7 @@ static int _read(struct dtls_context_t *ctx, session_t *session, uint8_t *buf,
     sock->buffer.session = session;
     if (sock->async_cb != NULL) {
+        memcpy(&sock->async_cb_session, session, sizeof(session_t));

Question is: what do you do, if there were multiple events fired before the handler comes to handling it. With your approach you will always only have the chance to get the session of the last event fired (which given that events are identified by a bitfield you can't determined which it was).

You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20210113/c5466cdd/attachment-0001.htm>

More information about the notifications mailing list