Use "BIO_set_nbio_accept" and this will work as you want it to.

Jim



Thanks for the feedback, but the BIO_set_nbio still doesn't seem to work. Here is what I am doing. I have a function which creates the accept BIO and calls BIO_set_nbio as follows (this is obviously trimmed down from my actual function):

        BIO* ret = BIO_new_accept(hostString);
        if (ret != NULL)
        {
            BIO_set_nbio(ret, 1); // This returns 1??
            BIO_set_bind_mode(ret, BIO_BIND_REUSEADDR);
            /* bind & listen */
            if (BIO_do_accept(ret) > 0)
            {
                return ret;
            }
...

now in my elsewhere in the program I have a 'startlistening' function which does the following:

        acceptRet = BIO_do_accept(sock);
        if (acceptRet > 0)
        {
            BIO* client = NULL;
            SSL* ssl = NULL;
            client = BIO_pop(sock);
            ssl = SSL_new(gCtx);
...

I would expect that the BIO_do_accept would return immediately if there was no connections waiting. It does not.

Any thoughts on what I am doing wrong?

Thanks
Jim

______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
User Support Mailing List                    openssl-users@openssl.org
Automated List Manager                           [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