home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.unix.programmer
- Path: sparky!uunet!arakis.fdn.org!gamb.fdn.org!fizz!ben
- From: ben@fizz.fdn.org (Benoit Grange)
- Subject: Re: Determining the state of a process on another host
- Message-ID: <1992Dec14.180723.263@fizz.fdn.org>
- Sender: ben@fizz.fdn.org (Benoit Grange)
- References: <1gau54INNndc@early-bird.think.com>
- Date: Mon, 14 Dec 1992 18:07:23 GMT
- Lines: 30
-
- In article <1gau54INNndc@early-bird.think.com> barmar@think.com (Barry
- Margolin) writes:
- > In article <1992Dec10.154438.13881@dd.dk> wes@dd.dk (Mads Westermann)
- writes:
- > >I'm currently writing a client-server application that uses BSD
- > >sockets to communicate. At certain stages in the processing I
- > >want to be able to determine whether the client process is
- > >running/alive.
- >
- > If you're using a stream socket, you can try to write something to it.
- > When the client process died, the remote system should have closed the
- > connection. If you try to write to a closed connection you should get
- an
- > error (EPIPE, I think).
-
- If you are watching via a select() the status of your stream socket, the
- select() call will report something to read or some exeptional event as
- soon as the other side of the socket is closed.
-
- The 'are you there ?' method suggsted by Sean.Levy@cs.cmu.edu is also a
- good method if the remote process is not busy in a long calculation.
-
- Datagramm sockets should report 'port is unreachable' if no program is
- listening on the remote port you requested, but I never seen it working.
-
- --
- ----
- Benoit Grange - PARIS - FRANCE
-
- Mail to : ben@fizz.fdn.org (SMALL NeXTMails accepted, < 10kb)
-