On Wed, 29 Apr 1998, Goetz Babin-Ebell wrote:
> What is the best way to test if a BIO is still alive ?
> Say:
> I have a BIO to a socket and want to test if the other side has closed
> the connection.
If you have it in non-blocking mode, try to read some data from it.
If it is closed, you should get back 0, or a -1 with error other than
a 'retryable'. BIO_sock_should_retry(int error) has all (I think) of
the cases covered. If you pass 0 or -1 as the 'error' code to check,
this function will use the relevent 'errno' or WSAGetLastError() call
depending on unix or windows to lookup the error code.
eric
+-------------------------------------------------------------------------+
| Administrative requests should be sent to [EMAIL PROTECTED] |
| List service provided by Open Software Associates, http://www.osa.com/ |
+-------------------------------------------------------------------------+