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
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
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;
--- 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
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
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
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
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
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;
); //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
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
,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
(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
());
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
= 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
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
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.
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
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.
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
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
]'
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
22 matches
Mail list logo