![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| High Level Programming Post questions about C, C++, Java, SQL, and other programming languages here. |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Socket programming | maracumbigo | High Level Programming | 4 | 02-10-2008 11:34 PM |
| C Network Programming - recv() help | Octal | High Level Programming | 2 | 05-11-2007 10:33 PM |
| UDP socket - can both client and server recv and send | rvan | High Level Programming | 1 | 05-08-2007 11:36 PM |
| Socket Programming socket | soshell | High Level Programming | 2 | 06-29-2004 04:49 AM |
| TCP Programming problems with 'recv' | KrazyGuyPaul | IP Networking | 1 | 09-12-2002 02:17 PM |
|
|
Submit Tools | LinkBack | Thread Tools | Display Modes |
|
#1
|
|||
|
|||
|
recv syscall for socket programming
I have a question regarding the recv syscall.
Suppose I have a client/server and the following exchange of message took place: Client --> Server using multiple send syscalls one after another immediately: send "Packet1" send "Packet2" send "Packet3" Server receives in the following order, taking a long time (couple of secs) to process each message received: recv "Packet1" -take 2 secs to process "Packet1" recv "Packet2Packet3" What throws me off is the second recv call that the server gets after processing the first recv call. The message is the contents of BOTH the packet 2 and packet 3 that the cilent sends. It seems that recv reads whatever that is in the buffer, and not the sequence that message comes in. Is that true? What I am planning to have is a server behaivor that is like this: recv "Packet1" - 2 sec of processing time recv "Packet2" - 2 sec of processing time recv "Packet3" - 2 sec of processing time For example, since 3 messages are sent to the server, the server will have to call 3 recv explicity to get each individual message even though they are all already in the input buffer. Is that possible with recv? Thanks
__________________
If only life is as simple as C... |
| Forum Sponsor | ||
|
|
|
#2
|
|||
|
|||
|
Thanks, that make sense
__________________
If only life is as simple as C... |
|
#3
|
|||
|
|||
|
Thanks, that make sense
hi,
i'm facing the same problem too, i know the reason, but struggling to solve it. i found there is a socket type which will recv, packets exactly in the same order sent, without reading the whole junk from buffer... if u know a way, kindly post.... Thnx, sri |
|||
| Google The UNIX and Linux Forums |