remove unnecessary nonblock calls and update to _dtls_ on relevant calls

pull/218/head
kaleb-himes 2020-07-07 09:33:17 -06:00
parent ad1b2f2288
commit f45184fc4a
5 changed files with 3 additions and 11 deletions

View File

@ -110,7 +110,7 @@ int main (int argc, char** argv)
}
wolfSSL_set_fd(ssl, sockfd);
wolfSSL_set_using_nonblock(ssl, 1);
wolfSSL_dtls_set_using_nonblock(ssl, 1);
fcntl(sockfd, F_SETFL, O_NONBLOCK);
/*****************************************************************************/

View File

@ -225,7 +225,7 @@ int main(int argc, char** argv)
/* set the/ session ssl to client connection port */
wolfSSL_set_fd(ssl, clientfd);
wolfSSL_set_using_nonblock(ssl, 1);
wolfSSL_dtls_set_using_nonblock(ssl, 1);
/*****************************************************************************/
/* NonBlockingDTLS_Connect code */

View File

@ -153,10 +153,6 @@ int main(int argc, char **argv)
/* associate the file descriptor with the session */
wolfSSL_set_fd(ssl, sockfd);
/* tell wolfSSL that nonblocking is going to be used */
wolfSSL_set_using_nonblock(ssl, 1);
/* setting up and running nonblocking socket */
ret = wolfSSL_connect(ssl);
error = wolfSSL_get_error(ssl, 0);

View File

@ -202,8 +202,7 @@ int main()
wolfSSL_set_fd(ssl, connfd);
sockfd = wolfSSL_get_fd(ssl);
/* set wolfSSL and socket to non blocking and respond */
wolfSSL_set_using_nonblock(ssl, 1);
/* set socket to non blocking and respond */
if (fcntl(connfd, F_SETFL, O_NONBLOCK) < 0) {
printf("Fatal error : fcntl set failed\n");
return 1;

View File

@ -130,9 +130,6 @@ int main(int argc, char** argv)
/* Attach wolfSSL to the socket */
wolfSSL_set_fd(ssl, sockfd);
/* make wolfSSL object nonblocking */
wolfSSL_set_using_nonblock(ssl, 1);
/* Connect to wolfSSL on the server side */
while (wolfSSL_connect(ssl) != SSL_SUCCESS) {
if (wolfSSL_want_read(ssl)) {