Jim Fox wrote:
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?
As far as I know you have to separately do the non-blocking setup
for both the listen socket and the accept socket.
What works for me is this: (continuing from your previous example)
.. previous listening code .. (with the BIO_set_nbio_accept)
acceptRet = BIO_do_accept(sock);
if (acceptRet > 0)
{
BIO* client = NULL;
SSL* ssl = NULL;
client = BIO_pop(sock);
ssl = SSL_new(gCtx);
then something like:
SSL_set_bio(ssl, client, client);
SSL_set_accept_state(ssl);
int sl = 1;
BIO_socket_ioctl(SSL_get_fd(ssl),FIONBIO,&sl);
I suppose it's a full circle return to the "everybody
uses BIO_socket_ioctl," but it does work.
Thanks for taking the time to answer my question Jim, I appreciate it!
-Jim
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]