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

János Brodbeck notifications at github.com
Wed May 26 15:36:49 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);

Will add. Regarding moving destroy to dsm, see my comment in the discussion about `dsm_drop_oldest_used_session()`.

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


More information about the notifications mailing list