[riot-notifications] [RIOT-OS/RIOT] tinydtls: add `sock_async` support for `sock_dtls` (#12907)

Martine Lenders notifications at github.com
Wed May 27 16:57:47 CEST 2020


@miri64 commented on this pull request.



> +        else if (mbox_try_get(&sock->mbox, &msg) &&
+                 msg.type == DTLS_EVENT_CONNECTED) {
+            memcpy(&remote->dtls_session, msg.content.ptr, sizeof(session_t));
+            if (sock->async_cb) {
+                sock_async_flags_t flags = SOCK_ASYNC_CONN_RDY;
+
+                if (cib_avail(&sock->mbox.cib)) {
+                    if (sock->buf) {
+                        flags |= SOCK_ASYNC_MSG_RECV;
+                    }
+                    else {
+                        flags |= SOCK_ASYNC_CONN_RECV;
+                    }
+                }
+                sock->async_cb(sock, flags, sock->async_cb_arg);
+            }
+            return -SOCK_DTLS_HANDSHAKE;
+        }

Yes.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/RIOT-OS/RIOT/pull/12907#discussion_r431204328
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20200527/885c9e3a/attachment.htm>


More information about the notifications mailing list