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                    openssl-users@openssl.org
Automated List Manager                           [EMAIL PROTECTED]

Reply via email to