This is a discussion on RE: client crash or network issue? - Openssl ; Md Lazreg wrote: > Actually the same question is valid even if I am not using SSL sockets. > So is there a way to distinguish between if a socket was closed because > of a client crash or because ...
Md Lazreg wrote:
> Actually the same question is valid even if I am not using SSL sockets.
> So is there a way to distinguish between if a socket was closed because
> of a client crash or because of a netwrok issue?. If yes, is there an
> equivalent under SSL sockets?
You have three choices:
1) Always assume the client might return. Delay returning resources for a
reasonable amount of time.
2) Guess based on the error code. For ECONNRESET, assume the client might
come back. For ETIMEDOUT, assume it won't. For an apparently normal close
(but at an unexpected time), assume it crashed. You'll be right some
fraction of the time, depending on what types of errors happen.
3) Code a reliable method to tell. For example, code a way to probe if the
client machine is still around (perhaps a separate daemon to report presence
or report the crash of the client program). Code a proxy on the client (that
is reliable enough to 'almost never' crash) that can report the loss of the
other end of the proxy (the real client program) or similarly engineer a
OpenSSL Project http://www.openssl.org
User Support Mailing List firstname.lastname@example.org
Automated List Manager email@example.com