Hi The c-client library/API does its own socket I/O for non-SSL sessions, but in SSL the socket I/O is delegated to OpenSSL.
When c-client does its own socket I/O, it sets a timeout (normally 15 seconds) on a select() call prior to doing any read() or write() calls. Thus, c-client never does a read() or write() that would block. If the select() timeout hits, there is a callback to the application to enquire whether the application wants to continue waiting. If the application chooses to continue waiting, the select() is restarted with an updated timeout. Otherwise, the socket is closed and the application receives a corresponding I/O error. The net effect is that a non-SSL I/O can wait forever as long as the application consents. c-client does not unilaterally disconnect. My problem is that this doesn't happen with SSL sessions because the socket I/O has been delegated to OpenSSL. There is no obvious way to instruct OpenSSL to timeout its socket I/O, much less do the mechanism described above. So, the questions are: (1) Is there a way to set a timeout for OpenSSL's socket I/O (given that it has been delegated to OpenSSL)? If so, how? (2) If the answer is "yes", is there a way to do the "query" type timeout described above? If so, how? (3) If the answer to either (1) or (2) is "no", then how would we go about altering the OpenSSL consumer (which, in this case, is c-client) so that OpenSSL uses the consumer's socket I/O code instead of OpenSSL's socket I/O code? I'm hoping that you will tell me that there's some callback function pointer that can be passed. -Parimal -- -- Warm Regards, Parimal Das