Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added OS-level timeout support for the DTLS I/O callbacks examples #487

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

gasbytes
Copy link

DTLS client and server callback implementations to handle socket timeouts during the DTLS handshake.

@gasbytes gasbytes force-pushed the timeout-dtls-examples branch from d1a09e3 to 8ed811c Compare February 14, 2025 14:02
@dgarske dgarske marked this pull request as ready for review February 14, 2025 16:53
@@ -70,6 +71,31 @@ int my_IORecv(WOLFSSL* ssl, char* buff, int sz, void* ctx)

printf("my_IORecv fd %d, buf %d\n", shared->sd, sz);

/* Get current DTLS handshake timeout. */
int dtls_timeout = wolfSSL_dtls_get_current_timeout(ssl);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Variable decl at the top of the function.

/* Receive datagram */
recvd = recvfrom(shared->sd, buff, sz, 0, &addr, &addrSz);

int dtls_timeout = wolfSSL_dtls_get_current_timeout(ssl);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Variable decl at top.

@@ -29,6 +29,7 @@
#endif
#include <wolfssl/wolfcrypt/settings.h>
#include <wolfssl/ssl.h>
#include <wolfssl/internal.h>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No internal include

@gasbytes gasbytes force-pushed the timeout-dtls-examples branch from 90b9dd3 to 81c7e54 Compare February 19, 2025 17:35
@gasbytes gasbytes removed their assignment Feb 19, 2025
Copy link
Member

@julek-wolfssl julek-wolfssl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The server eats the first packet with the recvfrom. Fix the server so that it doesn't drop the first packet.

@gasbytes gasbytes force-pushed the timeout-dtls-examples branch from 81c7e54 to e89973b Compare February 20, 2025 17:49
@gasbytes gasbytes assigned julek-wolfssl and unassigned gasbytes Feb 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants