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 runs out. >
By a strange coincidence I added some code to the ocsp application a couple of days ago that covers this situation. What you should do is call BIO_should_retry() if you get <= 0 return from BIO_do_connect() in fact until it connects you'll get BIO_should_retry_special() as true. You can loop until you get an error or BIO_do_connect() succeeds but that isn't very efficient and it non portable with the current connect BIO implementation on Windows as I found out when I tried the updated ocsp application with a timeout on WIN32. That should be fixed I suppose. 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 often done for example. Steve. -- Dr Stephen N. Henson. Email, S/MIME and PGP keys: see homepage OpenSSL project core developer and freelance consultant. Funding needed! Details on homepage. Homepage: http://www.drh-consultancy.demon.co.uk ______________________________________________________________________ OpenSSL Project http://www.openssl.org User Support Mailing List openssl-users@openssl.org Automated List Manager [EMAIL PROTECTED]