[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 21 18:18:09 CET 2021

@miri64 commented on this pull request.

> @@ -134,9 +138,19 @@ static void _dtls_handler(sock_dtls_t *sock, sock_async_flags_t type, void *arg)
     if (type & SOCK_ASYNC_CONN_RDY) {
-        puts("Session became ready");
+        if (sock_dtls_get_event_session(sock, &session)) {
+            sock_udp_ep_t ep;
+            sock_dtls_session_get_udp_ep(&session, &ep);
+            printf("Session became ready: ");
+            print_ipv6_addr_with_port(ep.addr.ipv6, sizeof(ep.addr), ep.port);

Any reason why you not use `sock_udp_ep_fmt()` from `sys/include/net/sock/util.h` here? Seems like re-inventing the wheel.

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/20210121/8b2e180a/attachment.htm>

More information about the notifications mailing list