On 6/21/2011 2:53 AM, ml.vladimbe...@gmail.com wrote:
Jim, for me the main goal to replace functions that operate with sockets is performance. I want to use OpenSSL with Windows IO Completion ports. The method that you suggest is very interesting but the main is not achieved - OpenSSL is still writing to the socket. Besides we got so-called "double buffering" and also more memory usage because of 2 sockets.
I do exactly this using BIO pairs. I manage all four data streams. When the application wants to send data to the other side, I hand it to OpenSSL. When I receive data on the socket, I hand it to OpenSSL. When I can send data on the socket, I get it from OpenSSL and send it to the socket. When OpenSSL has decrypted data, I get it from OpenSSL and send it to the upper application layers.
Just remember that you have four I/O streams you have to handle -- encrypted in, encrypted out, plaintext in, plaintext out. Make no attempt to 'associate' these streams. Treat them as completely logically independent.
DS ______________________________________________________________________ OpenSSL Project http://www.openssl.org User Support Mailing List openssl-users@openssl.org Automated List Manager majord...@openssl.org