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

Martine Lenders notifications at github.com
Wed May 13 10:28:21 CEST 2020

@miri64 commented on this pull request.

> @@ -657,28 +669,27 @@ ssize_t sock_dtls_recv_buf(sock_dtls_t *sock, sock_dtls_session_t *remote,
  *                      if no session exist between client and server.
  * @param[in] data      Pointer where the data to be send are stored
  * @param[in] len       Length of @p data to be send
- *
- * @note Function may block until a session is created if there is no
- *       existing session with @p remote.
- *
- * @note Initiating a session through this function will require
- * @ref sock_dtls_recv() called from another thread to receive the handshake
- * messages.
+ * @param[in] timeout   Handshake timeout in microseconds.
+ *                      If `0`, the function returns after new handshake process
+ *                      is started.

I am not sure that is a good idea, API-wise. IMHO, with timeout=0 the session should already be created. If not, the function should just return an error and not inititialize anything.

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/20200513/22a519cb/attachment-0001.htm>

More information about the notifications mailing list