home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!ogicse!emory!sol.ctr.columbia.edu!zaphod.mps.ohio-state.edu!rpi!cecchinr
- From: cecchinr@gehrig.cs.rpi.edu (Ron Cecchini)
- Newsgroups: comp.unix.wizards
- Subject: Q: Proper client/server protocol w.r.t. socket read/writes
- Message-ID: <0ck1+wp@rpi.edu>
- Date: 6 Nov 92 23:06:24 GMT
- Article-I.D.: rpi.0ck1+wp
- Organization: Rensselaer Polytechnic Institute, Troy, NY
- Lines: 24
- Nntp-Posting-Host: gehrig.cs.rpi.edu
-
- Hi all - I figured it was ok to post this here, since it is a socket question.
-
- Basically, I just want to know what is the proper protocol to use when
- I am simultaneously reading/writing from/to a socket. I am looking at
- some client/server code that a friend wrote, and every time she does a
- write, she immediately does a read to acknowledge that the info got to
- the other side - I'll draw a picture:
-
- Client: Write "info" Server: Read "info"
- Write "received info"
- Client: Read - if equals "received info"
- then do the next write
- else error
-
- You get the picture... My question is: is this the standard way of doing
- this? It seems like you double the processing time by having to read
- for every write, and vice-versa. She says that when she didn't do this,
- her application crashed because of some kind of "imbalance".
-
- I just want to know if this is what I have to and, if not, then what is the
- right way.
-
- Thanx a mil,
- Ron
-