-
Notifications
You must be signed in to change notification settings - Fork 178
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
base: master
Are you sure you want to change the base?
Conversation
d1a09e3
to
8ed811c
Compare
dtls/client-dtls-callback.c
Outdated
@@ -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); |
There was a problem hiding this comment.
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.
dtls/server-dtls-callback.c
Outdated
/* Receive datagram */ | ||
recvd = recvfrom(shared->sd, buff, sz, 0, &addr, &addrSz); | ||
|
||
int dtls_timeout = wolfSSL_dtls_get_current_timeout(ssl); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Variable decl at top.
8ed811c
to
90b9dd3
Compare
dtls/server-dtls-callback.c
Outdated
@@ -29,6 +29,7 @@ | |||
#endif | |||
#include <wolfssl/wolfcrypt/settings.h> | |||
#include <wolfssl/ssl.h> | |||
#include <wolfssl/internal.h> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No internal include
90b9dd3
to
81c7e54
Compare
There was a problem hiding this 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.
81c7e54
to
e89973b
Compare
DTLS client and server callback implementations to handle socket timeouts during the DTLS handshake.