On Fri, Sep 07, 2007, Jim Marshall wrote:

> Jim Fox wrote:
> >
> >Use "BIO_set_nbio_accept" and this will work as you want it to.
> >
> >Jim
> >
> 
> Arg, thanks Jim - somewhere along the line I mixed that up! Changing to 
> that causes the BIO_do_accept call to not block. Although BIO_do_accept 
> returns -1 and errno is set to EAGAIN, the SSL_get_error() function 
> returns SSL_ERROR_NONE. is that expected?
> 
> So beyond the BIO_do_accept, I used the openssl client program to 
> connect to my server. I was expecting the above to make all the sockets 
> non-blocking, but when I called SSL_read in my code it seems to block 
> for data. I tried using the BIO_set_nbio an BIO_set_nbio_accept calls 
> but no joy.
> 
> Basically i am trying to make all the socket calls non-blocking, what am 
> I missing?
> 

Have you called BIO_set_nbio() on the accept BIO as well?

BIO_set_nbio_accept() makes the accept BIO non blocking so waiting for an
incoming connection does not block.

BIO_set_nbio() makes all subsequent connected BIOs non-blocking.

The SSL_get_error() calls return depends on where you called it. If the BIO
doesn't have an associated SSL structure then the BIO_should_retry() and calls
should be used instead.

Steve.
--
Dr Stephen N. Henson. Email, S/MIME and PGP keys: see homepage
OpenSSL project core developer and freelance consultant.
Funding needed! Details on homepage.
Homepage: http://www.drh-consultancy.demon.co.uk
______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
User Support Mailing List                    openssl-users@openssl.org
Automated List Manager                           [EMAIL PROTECTED]

Reply via email to