home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #16 / NN_1992_16.iso / spool / comp / unix / internal / 1596 < prev    next >
Encoding:
Text File  |  1992-07-23  |  4.0 KB  |  78 lines

  1. Newsgroups: comp.unix.internals
  2. Path: sparky!uunet!sun-barr!cs.utexas.edu!hellgate.utah.edu!fcom.cc.utah.edu!gateway.univel.com!gateway.novell.com!ithaca!terry
  3. From: terry@ithaca.npd.Novell.COM (Terry Lambert)
  4. Subject: Re: Multiple listeners on same socket
  5. Message-ID: <1992Jul23.161536.18215@gateway.novell.com>
  6. Sender: terry@ithaca (Terry Lambert)
  7. Nntp-Posting-Host: ithaca.eng.sandy.novell.com
  8. Organization: Novell NPD -- Sandy, UT
  9. References: <1992Jul22.034730.12159@menudo.uh.edu> <1992Jul23.084108.22337@rdg.dec.com> <1992Jul23.140202.9816@menudo.uh.edu>
  10. Date: Thu, 23 Jul 1992 16:15:36 GMT
  11. Lines: 65
  12.  
  13. In article <1992Jul23.140202.9816@menudo.uh.edu>, nagappa@menudo.uh.edu (Chaitanya Nagappa) writes:
  14. |> The  following reply is again posted for a friend, viz, Ravi Ramachandran.
  15. |> -C. Nagappa.
  16. |> ---------------------------------------------------------------------------
  17. |> 
  18. |> In article <1992Jul23.084108.22337@rdg.dec.com> jfoy@narcy.gao.dec.com (John Foy) writes:
  19. |> >
  20. |> >In article <1992Jul22.034730.12159@menudo.uh.edu>, nagappa@menudo.uh.edu writes:
  21. |> >|>==============================================================================
  22. |> >|>Howdy all,
  23. |> >|>I need something equivalent to a socket, but that more than one process
  24. |> >|>can listen on. This is for multiple consumers, and the output from the
  25. |> >|>server can be picked up by any one of the consumers. In the simplest
  26. |> >|>scenario, I have two processes doing a "listen" on the same socket,
  27. |> >|>and only one of these process is trigerred to establish the circuit.
  28. |> >|>[...]
  29. |> >|>The problem of statically placing this using standard IPC methods such as
  30. |> >|>message queues, FIFOs or shared memory is that by the time my processes
  31. |> >|>get around to receiving the info. (worst case scenario) the call might
  32. |> >|>have been cleared. So I need a phased communication of the info.
  33. |> >
  34. |> >I'm not sure what you mean by "phased communcation..."?
  35. |> >
  36. |> I need both sides to establish communication/ know it was established -
  37. |> similar to that of a virtual circuit establishment (SYNC, ACK, etc.).
  38.  
  39. This is kind of questionable; how do you know that the appropriate server gets
  40. all the packets for a particular connection?  Bletch...
  41.  
  42. |> >I'm not entirely familiar with select etc... (being more of a VMS'r) but have
  43. |> >you considered semaphores? e.g. the server pool waits on a counting semaphore
  44. |> >which is incremented by the 'dispatching' process (I think you refer to this
  45. |> >as the 'spawned' process)...? This way only available servers respond...
  46. |> >
  47. |> "select" enables the process to work wait for an event to occur on one of
  48. |> multiple file descriptors - FIFOs, streams, etc. Unfortunately, not on
  49. |> message queues, semaphores, or any other muliplexed listening posts.
  50.  
  51. VMS equivalent: SYS$WAITEFLOR()
  52.  
  53. |> From a fellow netter I had received a possible solution using signals.
  54. |> Unfortunately, there is the problem that multiple signals, before processing
  55. |> it, will be seen as a single signal. Another reply indicated that this
  56. |> was a flaw with standard Unix implementation that device driver writers
  57. |> had to deal with; unfortunately, the solution was propreitary.
  58.  
  59. I don't really understand the problem; why can't you have two readers on the
  60. same socket?  Are you saying that your reads will not get full packets?  I
  61. can't see a situation where this would occur, unless you are talking about
  62. "packets" for your user level protocol which are fragged, or unless you have
  63. a vmin set to smaller than the packet size you are reading for.  An alternative
  64. complaint could be that select wakes both processes... is this the case?
  65.  
  66. You need to state, in simple terms, the behaviour you are seeing and the
  67. behaviour you expect to see; your expectations should be in terms of what you
  68. want to do, not in terms of "it would be nice if select()...".  Once that this
  69. is done, I'm sure someone here can help you, if only to tell you it's impossible.
  70.  
  71.  
  72.                     Terry Lambert
  73.                     terry_lambert@gateway.novell.com
  74.                     terry@icarus.weber.edu
  75. ---
  76. Disclaimer:  Any opinions in this posting are my own and not those of
  77. my present or previous employers.
  78.