home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #26 / NN_1992_26.iso / spool / comp / unix / wizards / 4591 < prev    next >
Encoding:
Text File  |  1992-11-10  |  1.4 KB  |  36 lines

  1. Newsgroups: comp.unix.wizards
  2. Path: sparky!uunet!spool.mu.edu!yale.edu!ira.uka.de!Germany.EU.net!rzsun2.informatik.uni-hamburg.de!arne
  3. From: arne@nats.informatik.uni-hamburg.de (Arne Ludwig)
  4. Subject: Re: Q: Proper client/server protocol w.r.t. socket read/writes
  5. Message-ID: <arne.721414999@nats5>
  6. Sender: news@informatik.uni-hamburg.de (Mr. News)
  7. Organization: University of Hamburg, FRG
  8. References: <0ck1+wp@rpi.edu>
  9. Date: 10 Nov 92 17:03:19 GMT
  10. Lines: 24
  11.  
  12. cecchinr@gehrig.cs.rpi.edu (Ron Cecchini) writes:
  13. >every time she does a
  14. >write, she immediately does a read to acknowledge that the info got to 
  15. >the other side
  16.  
  17. >She says that when she didn't do this,
  18. >her application crashed because of some kind of "imbalance".
  19.  
  20. You don't supply enough information, but this suggests to me that she
  21. might be using a stream socket and variable length messages.
  22.  
  23. If she's not acknowledging the individual packets, this may, and almost
  24. always does, mean that some messages get mixed up with previous ones,
  25. because streams are not "packetized".
  26.  
  27. You may think of avoiding this problem by using datagram sockets, but
  28. unfortunately most Unices don't give you reliable, sequenced delivery
  29. on datagrams sockets, so you would need the acknowledge after all.
  30.  
  31. A very simple solution is to use fixed packet lengths, or transmitting
  32. length information with each packet.
  33. --
  34. Arne Ludwig
  35. ludwiga@informatik.uni-hamburg.de            arne@rrzbu.hanse.de
  36.