[riot-notifications] [RIOT-OS/RIOT] sock_dtls: add timeout to sock_dtls_send and sock_dtls_session_create (#14043)

Aiman Ismail notifications at github.com
Wed May 13 09:18:05 CEST 2020


@pokgak commented on this pull request.



>              /* handshake initiated, wait until connected or timed out */
 
             msg_t msg;
             do {
-                res = xtimer_msg_receive_timeout(&msg, 3 * DTLS_HANDSHAKE_TIMEOUT);
+                uint32_t start = xtimer_now_usec();
+                res = xtimer_msg_receive_timeout(&msg, timeout);
+
+                if (timeout != SOCK_NO_TIMEOUT) {
+                    timeout = _update_timeout(start, timeout);
+                }

Looking back, `EHOSTUNREACH` might be the wrong status code as it is for routes (no routes to host) but we don't know that here. We only know that `xtimer_msg_receive_timeout` has timed out.

-- 
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/14043#discussion_r424221796
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20200513/a579fdd6/attachment.htm>


More information about the notifications mailing list