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

benpicco notifications at github.com
Wed May 26 14:28:10 CEST 2021


@benpicco commented on this pull request.



> +        sock_udp_ep_t ep;
+        sock_dtls_session_get_udp_ep(&socket.ctx_dtls_session, &ep);
+        _process_coap_pdu(&socket, &ep,  _listen_buf, res);
+    }
+}
+#endif
+
+#if IS_ACTIVE(CONFIG_GCOAP_ENABLE_DTLS)
+/* Timeout function to free up a session when too many session slots are occupied */
+static void _dtls_free_up_session(void *arg) {
+    (void)arg;
+    sock_dtls_session_t session;
+
+    uint8_t minimum_free = CONFIG_GCOAP_DTLS_MINIMUM_AVAILABLE_SESSIONS;
+    if (dsm_get_num_available_slots() < minimum_free) {
+        if(dsm_get_oldest_used_session(&_sock_dtls, &session) != -1) {

Yes, if the only reason to get the oldest session is to destroy it, it might as well be done internally. 

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


More information about the notifications mailing list