mirror of
https://github.com/wolfSSL/wolfssl.git
synced 2026-04-19 06:38:40 +02:00
DTLS to use recvfrom and sendto in embed recv and send callbacks. Added support for storing dtls peer address.
This commit is contained in:
@@ -70,8 +70,6 @@ void echoclient_test(void* args)
|
||||
doDTLS = 1;
|
||||
#endif
|
||||
|
||||
tcp_connect(&sockfd, yasslIP, yasslPort, doDTLS);
|
||||
|
||||
#if defined(CYASSL_DTLS)
|
||||
method = DTLSv1_client_method();
|
||||
#elif !defined(NO_TLS)
|
||||
@@ -102,6 +100,16 @@ void echoclient_test(void* args)
|
||||
#endif
|
||||
ssl = SSL_new(ctx);
|
||||
|
||||
if (doDTLS) {
|
||||
SOCKADDR_IN_T addr;
|
||||
build_addr(&addr, yasslIP, yasslPort);
|
||||
CyaSSL_dtls_set_peer(ssl, &addr, sizeof(addr));
|
||||
tcp_socket(&sockfd, 1);
|
||||
}
|
||||
else {
|
||||
tcp_connect(&sockfd, yasslIP, yasslPort, 0);
|
||||
}
|
||||
|
||||
SSL_set_fd(ssl, sockfd);
|
||||
#if defined(USE_WINDOWS_API) && defined(CYASSL_DTLS) && defined(NO_MAIN_DRIVER)
|
||||
/* let echoserver bind first, TODO: add Windows signal like pthreads does */
|
||||
|
||||
Reference in New Issue
Block a user