Unix Programming - Re: recv() - How do you know the length of buffer that you are going

This is Interesting: Free IT Magazines  
Home > Archive > Unix Programming > December 2005 > Re: recv() - How do you know the length of buffer that you are going





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author Re: recv() - How do you know the length of buffer that you are going
Nils O. Selåsdal

2005-12-19, 6:02 pm

Dale Hagglund wrote:

> Steven> So at the recv() end, the first recv() will receive the
> Steven> number of bytes from the first send()? So that the 2nd
> Steven> recv() will be the retrieval of the actual message?
>
> No. Recv() does not know *anything* about how many times send() was
> called on the other end.

Just to not confuse the original poster, or perhaps to bring further
confusion ;-) the above is true for TCP, and other protocols that
presents an octet stream to the application.

For message based protocols, such as UDP or SCTP(initialized in the
proper mode for messaging) one recv DOES match one send at the other
end. Same applies, you have to have an application protocol so you
know what you're doing, ofcourse.
Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com