home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #30 / NN_1992_30.iso / spool / comp / unix / programm / 5695 < prev    next >
Encoding:
Text File  |  1992-12-14  |  1.6 KB  |  41 lines

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