I'm a little confused as to how to manage a non-blocking accept call. Specifically I don't understand what the expected return from BIO_do_accept() should be when non-blocking is turned on. How can I tell that the BIO_do_accept() call returned because it is non-blocking vs. an actual error occurred?

My code looks like:
       if ( useNonBlocking == TRUE )
       {
               BIO_get_fd(acc, &acceptFD);
               flags = fcntl(acceptFD, F_GETFL);
               flags |= O_NONBLOCK;
               fcntl(acceptFD, F_SETFL, flags);
       }

       ret = BIO_do_accept(acc);
       if  ( ret <= 0)
       {
               /* Failed to accept a connection */
               return ret;
       }

When I turn nonblocking on the call to BIO_do_accept returns -3. Should I just always check for -3, or is there an enum I can check, or some method (similar to SSL_get_error() where I can see something like SSL_ERROR_WANT_READ) I can call?

Thanks,

                      -David-

______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
User Support Mailing List                    openssl-users@openssl.org
Automated List Manager                           [EMAIL PROTECTED]

Reply via email to