Re: Detecting a closed connection

[email protected] (Joshua N Pritikin)
Newsgroups perl.loop
Message-ID <[email protected]>
On Mon, Apr 10, 2000 at 07:02:02PM +0200, [email protected] wrote:
> in a client/server system running on base of Event, I check for closed
> connections and remove all related data from the server process, inform
> other related clients and so on. This is done via an io read/error event
> watcher. The callback calls a function that first of all checks the
> handle/socket by fileno(). Quite simple, but it works perfectly if a
> client dies a usual way, e.g. by signal.
> 
> Now, it does NOT work if the client system is shut down by switching off
> its hardware. The server system does not recognize this (remote shells
> do not close etc.)

Correct.

> So, there seems to be no catchable event. Are there
> known strategies to detect such cases?

IIRC, heartbeats.

-- 
"May the best description of competition prevail."
          via, but not speaking for Deutsche Bank
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.