So is it ok to uses socket ioctl functions on the socket file descriptor to figure out the socket is closed?

I have seen some BIO_ioctl function do I need to uses those instead to be more OpenSSL correct?

Thanks this was very informative.
Perry

Katie Lucas wrote:

On Tue, Dec 06, 2005 at 10:28:09AM -0500, Perry L. Jones wrote:
Hello,

I want to be able to handle unclean closing of an SSL socket. I have a client server applications and if the client dies for some reason I want to be able to check the SSL connection on the server side and then clean things up.

I have tried using the SSL_state() command but when my client dies the SSL_state() command is still telling me then socket state is OK (SSL_ST_OK).

Why is the state ok of the client is not longer connected?

How can I check that the client application is not longer connected?

You usually have to send data; it'll come back with an EOF error.

On UNIX you might have got a sigpipe about the underlying socket.

It's not an SSL thing, it's a socket thing. Sockets which are
quiescent don't send or transmit any data at all (there's no
"heartbeat"), so if (for any reason) the "close" messages aren't sent
when one end goes away, the other end doesn't find out until it tries
to send data and can't.

It's a sort of feature; means that (for example) ISDN lines can be
dropped and brought back up when data starts being sent again without
the application level interface (which in this case is SSL) noticing.

______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
User Support Mailing List                    openssl-users@openssl.org
Automated List Manager                           [EMAIL PROTECTED]

______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
User Support Mailing List                    openssl-users@openssl.org
Automated List Manager                           [EMAIL PROTECTED]

Reply via email to