Custom Non-Blocking BIO.

2011-03-13 Thread Keean Schupke
I have a custom BIO that I want to be non-blocking. Currently when calling SSL_connect when using this BIO, it is returning -1, but calling SSL_get_error after does not return SSL_ERROR_WANT_READ nor SSL_ERROR_WANT_WRITE. How does my custom BIO indicate that it supports non blocking IO? I tried

Re: Custom Non-Blocking BIO.

2011-03-13 Thread Dr. Stephen Henson
On Sun, Mar 13, 2011, Keean Schupke wrote: I have a custom BIO that I want to be non-blocking. Currently when calling SSL_connect when using this BIO, it is returning -1, but calling SSL_get_error after does not return SSL_ERROR_WANT_READ nor SSL_ERROR_WANT_WRITE. How does my custom BIO

Re: Non-blocking BIO and BIO_do_connect problem.

2006-07-24 Thread Marek Marcola
Hello, Marek Marcola wrote: For example: /* check socket error state - only if val == 0 after this call * connection is properly established. */ len = sizeof(int); if (getsockopt(fd, SOL_SOCKET, SO_ERROR, (void *) state, len) 0) { goto err;

Re: Non-blocking BIO and BIO_do_connect problem.

2006-07-23 Thread Girish Venkatachalam
--- Dr. Stephen Henson [EMAIL PROTECTED] wrote: On Sat, Jul 22, 2006, Bu Bacoo wrote: Thanks you both... after correcting my BIO_do_connect (and all read/write following it) - adding retries (as Girish pointed), it works just fine. Now I'll check the errors, mentioned by Darryl, to

Re: Non-blocking BIO and BIO_do_connect problem.

2006-07-23 Thread Dr. Stephen Henson
On Sat, Jul 22, 2006, Girish Venkatachalam wrote: --- Dr. Stephen Henson [EMAIL PROTECTED] wrote: The efficient thing to do depends on the underlying transport. Getting the actual socket description with BIO_get_fd() then calling select() while waiting for a write condition is

Re: Non-blocking BIO and BIO_do_connect problem.

2006-07-23 Thread Darryl Miles
Girish Venkatachalam wrote: I don't know what is supposed to happen in theory, but in practice I have found select() to be quite a disaster in informing me when a socket becomes writable. I have seen this on both Linux and FreeBSD. select() is very useful and an elegant solution for

Re: Non-blocking BIO and BIO_do_connect problem.

2006-07-23 Thread Marek Marcola
Hello, Girish Venkatachalam wrote: I don't know what is supposed to happen in theory, but in practice I have found select() to be quite a disaster in informing me when a socket becomes writable. I have seen this on both Linux and FreeBSD. select() is very useful and an elegant

RE: Non-blocking BIO and BIO_do_connect problem.

2006-07-23 Thread David Schwartz
I don't know what is supposed to happen in theory, but in practice I have found select() to be quite a disaster in informing me when a socket becomes writable. I have seen this on both Linux and FreeBSD. I have no idea why it gave you a problem. Lots of people do this and you're the

Re: Non-blocking BIO and BIO_do_connect problem.

2006-07-23 Thread Darryl Miles
Marek Marcola wrote: For example: /* check socket error state - only if val == 0 after this call * connection is properly established. */ len = sizeof(int); if (getsockopt(fd, SOL_SOCKET, SO_ERROR, (void *) state, len) 0) { goto err;

Re: Non-blocking BIO and BIO_do_connect problem.

2006-07-22 Thread Bu Bacoo
); //returns 1 BIO_do_connect(m_pBio); //returns 1 it works just fine,... .. but with non blocking: BIO* pBio = BIO_new_connect((char*)conn.c_str()); BIO_set_nbio(m_pBio,1); //returns 1 BIO_do_connect(m_pBio); //returns -1 It doesn't connect. Why could that be? Any idea please. Thanks Bu

Non-blocking BIO and BIO_do_connect problem.

2006-07-22 Thread Bu Bacoo
Hello, I'm having problem with BIO_do_connect, when trying to setup non-blocking behaviour for it. When using: BIO* pBio = BIO_new_connect((char*)conn.c_str()); BIO_set_nbio(m_pBio,0); //returns 1 BIO_do_connect(m_pBio); //returns 1 it works just fine,... .. but with non blocking: BIO* pBio

Re: Non-blocking BIO and BIO_do_connect problem.

2006-07-22 Thread Bu Bacoo
,0); //returns 1 BIO_do_connect(m_pBio); //returns 1 it works just fine,... .. but with non blocking: BIO* pBio = BIO_new_connect((char*)conn.c_str()); BIO_set_nbio(m_pBio,1); //returns 1 BIO_do_connect(m_pBio); //returns -1 It doesn't connect. Why could that be? Any idea please. Thanks

Re: Non-blocking BIO and BIO_do_connect problem.

2006-07-22 Thread Girish Venkatachalam
(m_pBio,0); //returns 1 BIO_do_connect(m_pBio); //returns 1 it works just fine,... .. but with non blocking: BIO* pBio = BIO_new_connect((char*)conn.c_str()); BIO_set_nbio(m_pBio,1); //returns 1 BIO_do_connect(m_pBio); //returns -1 It doesn't connect. Why could

Re: Non-blocking BIO and BIO_do_connect problem.

2006-07-22 Thread Darryl Miles
()); BIO_set_nbio(m_pBio,0); //returns 1 BIO_do_connect(m_pBio); //returns 1 it works just fine,... .. but with non blocking: BIO* pBio = BIO_new_connect((char*)conn.c_str()); BIO_set_nbio(m_pBio,1); //returns 1 BIO_do_connect(m_pBio); //returns -1 It doesn't connect. Why could that be? Any idea

Re: Non-blocking BIO and BIO_do_connect problem.

2006-07-22 Thread Bu Bacoo
= BIO_new_connect((char*)conn.c_str()); BIO_set_nbio(m_pBio,0); //returns 1 BIO_do_connect(m_pBio); //returns 1 it works just fine,... .. but with non blocking: BIO* pBio = BIO_new_connect((char*)conn.c_str()); BIO_set_nbio(m_pBio,1); //returns 1 BIO_do_connect(m_pBio); //returns -1

Re: Non-blocking BIO and BIO_do_connect problem.

2006-07-22 Thread Dr. Stephen Henson
On Sat, Jul 22, 2006, Bu Bacoo wrote: Thanks you both... after correcting my BIO_do_connect (and all read/write following it) - adding retries (as Girish pointed), it works just fine. Now I'll check the errors, mentioned by Darryl, to make it more clear, not just to retry until some counter

RE: Non-blocking BIO and BIO_do_connect problem.

2006-07-22 Thread David Schwartz
Thanks you both... after correcting my BIO_do_connect (and all read/write following it) - adding retries (as Girish pointed), it works just fine. Now I'll check the errors, mentioned by Darryl, to make it more clear, not just to retry until some counter runs out. Don't do that.

Re: non-blocking BIO

2004-05-17 Thread Patrick Coleman
For SSL_accept, you need to make the underlying socket non-blocking, rather than a non-blocking BIO. You can make a socket non-blocking with the 'fcntl' system call (check the manpages). You may also be interested in the excellent sockets tutorial 'Beej's Guide to Network Programming' located

Re: non-blocking BIO

2004-05-17 Thread Alexis Lefort
Thank you, I missed that! BIOs don't need any special settings to support non blocking I/O: if the underlying transport signals a call should be retried the BIO takes appropriate action. In other words you just have to set the underlying transport (socket normally) to a non blocking mode. Steve.

RE: Non-blocking BIO

2001-04-04 Thread Wirta, Ville
You are misinterpreting the meaning of BIO_should_retry(). What it is telling you is that you should wait until a certain condition is satisfied on the underlying transport (SOCKET in this case) before you retry. You can retry immediately but that is likely to be inefficient. Is it

non-blocking BIO

2001-04-02 Thread Wirta, Ville
before: BIO_do_connect(...); I get "Error connecting to server" even though my server says it got a new connection. ERR_print_errors_fp(stderr); doesn't say any error message. Now if anyone is familiar with non-blocking BIO I'd be pleased to hear I did something wron

RE: non-blocking BIO

2001-04-02 Thread Reddie, Steven
]' Subject: non-blocking BIO Hi! I was wondering how to set non-blocking mode on in my helper application (using OpenSSL). I found a BIO example at: http://www.openssl.org/docs/crypto/BIO_f_ssl.html# which worked fine until I tried to make it nonblocking by adding