Hello, > You need to put select(ready to read or write) inside each (BOTH > SSL_read() and SSL_write()) of your while loops at the beginning, and > then cycle on WANT_READ or WANT_WRITE for BOTH SSL_read() and > SSL_write() loops. > > You're getting high utilization because you are not putting select > inside the while loops. I'm not sure if this is good solution because this will give you semi-blocking behaviour (we are only in non-blocking wrapper and checking for read/write is done by select() in "upper" layer).
You should change loop ending condition - this loop should end when SSL_ERROR_WANT_READ or SSL_ERROR_WANT_WRITE occur because this errors may be returned on non-blocking sockets on SSL_read() and on SSL_write(). On normal use this will happen mostly where re-handshake is going on but this may happen where empty SSL fragments are sent over network (of course this may happen on some system condition too). When you get SSL_ERROR_WANT_WRITE where you do SSL_read() this means that SSL protocol needs to send something to your peer (some control/ handshake SSL information). Best regards, -- Marek Marcola <[EMAIL PROTECTED]> ______________________________________________________________________ OpenSSL Project http://www.openssl.org User Support Mailing List openssl-users@openssl.org Automated List Manager [EMAIL PROTECTED]