[riot-notifications] [RIOT-OS/RIOT] net/gcoap: support DTLS (#15549)

János Brodbeck notifications at github.com
Wed May 26 13:52:55 CEST 2021


@janosbrodbeck commented on this pull request.



> +        /* If not enough session slots left: set timeout to free up session */
+        uint8_t minimum_free = CONFIG_GCOAP_DTLS_MINIMUM_AVAILABLE_SESSIONS;
+        if (dsm_get_num_available_slots() < minimum_free)
+        {
+            uint32_t timeout = CONFIG_GCOAP_DTLS_MINIMUM_AVAILABLE_SESSIONS_TIMEOUT_USEC;
+            event_callback_init(&_dtls_session_free_up_tmout_cb,
+                                _dtls_free_up_session, NULL);
+            event_timeout_init(&_dtls_session_free_up_tmout, &_queue,
+                               &_dtls_session_free_up_tmout_cb.super);
+            event_timeout_set(&_dtls_session_free_up_tmout, timeout);
+        }
+    }
+
+    if (type & SOCK_ASYNC_CONN_FIN) {
+        if (sock_dtls_get_event_session(sock, &socket.ctx_dtls_session)) {
+            dsm_remove(sock, &socket.ctx_dtls_session);

`SOCK_ASYNC_CONN_FIN` is called when a session is closed from the remote peer. In that case, the session is already in closed state from tinyDTLS at this point. Since no other implementation exists, no idea how they would behave here. Would expect the same.

-- 
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/15549#discussion_r639652105
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20210526/e4d3e20a/attachment.htm>


More information about the notifications mailing list