I appreciate the reply but perhaps someone can provide some insight. Looking
at the man page it says this.
BIO_set_nbio() sets the non blocking I/O flag to n. If n is zero then
blocking I/O is set. If n is 1 then non blocking I/O is set. Blocking I/O is
the default. The call to BIO_set_nbio() should be made before the connection
is established because non blocking I/O is set during the connect process.
What does it mean that the non blocking I/O is set during the connect
process? Does it change the socket into non blocking afterwards or does it
revert back to blocking?
Hello,
> I am looking for a way to convert this segment of code. It's probably
> not right but here is the question. How would I retrieve the socket
> pointer from OpenSSL. Does OpenSSL even provide this? Also what does
> OpenSSL provide as a return from function SSL_get_fd when using
> Windows?
>
>
>
> void setBlocking(SSL * sslTemp)
>
> {
>
> int fd, flags;
>
>
>
> /* SSL_get_rfd returns -1 on error */
>
> if( (fd = SSL_get_rfd(sslTemp)) )
>
> #ifndef WIN32
>
> {
>
> flags = fcntl(fd, F_GETFL);
>
> flags &= ~O_NONBLOCK;
>
> fcntl(fd, F_SETFL, flags);
>
> }
>
> #else
>
> ioctlsocket( fd, FIOBIO, 0 );
>
> #endif
>
> /* SSL_get_wfd returns -1 on error */
>
> if( (fd = SSL_get_wfd(sslTemp)) )
>
> #ifndef WIN32
>
> {
>
> flags = fcntl(fd, F_GETFL);
>
> flags &= ~O_NONBLOCK;
>
> fcntl(fd, F_SETFL, flags);
>
> }
>
> #else
>
> ioctlsocket( fd, FIOBIO, 0 );
>
> #endif
>
> }
>
>
Not tested but maybe this is the way:
void setBlocking(SSL * sslTemp)
{
BIO_set_nbio(SSL_get_rbio(sslTemp),0);
BIO_set_nbio(SSL_get_wbio(sslTemp),0);
}
Best regards,
--
Marek Marcola <[EMAIL PROTECTED]>
______________________________________________________________________
OpenSSL Project http://www.openssl.org
User Support Mailing List [email protected]
Automated List Manager [EMAIL PROTECTED]
______________________________________________________________________
OpenSSL Project http://www.openssl.org
User Support Mailing List [email protected]
Automated List Manager [EMAIL PROTECTED]