remove unnecessary nonblock calls and update to _dtls_ on relevant calls
parent
ad1b2f2288
commit
f45184fc4a
|
|
@ -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);
|
||||
|
||||
/*****************************************************************************/
|
||||
|
|
|
|||
|
|
@ -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 */
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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)) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue