> I found out that if I keep calling SSL_write, if the connection > is closed remotely (killing stunnel), my application hangs.
I thought your problem was crashing. Now I see that it's hanging. These are two totally different problems. > I made some tests, and saw that the error happens only if I keep > calling SSL_write. The first SSL_write after closing the connection > returns a positive value, as if the closing wasn't seen. The second > causes the hanging. Your read handler doesn't handle SSL_WANT_WRITE. Your write handler doesn't handle any of the SSL_WANT errors. It doesn't surprise me that your code spins in non-blocking mode. DS ______________________________________________________________________ OpenSSL Project http://www.openssl.org User Support Mailing List openssl-users@openssl.org Automated List Manager [EMAIL PROTECTED]