Unix Programming - send/recv socket call

This is Interesting: Free IT Magazines  
Home > Archive > Unix Programming > October 2004 > send/recv socket call





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 send/recv socket call
DJP

2004-10-02, 9:13 pm

Hi,

I was just trying to understand the send/recv socket calls. Does a send call
block if the receiver hasn't executed a recv for the number of bytes that a
sender is sending? For example if A sends 50 bytes to B and the code in B
just does a recv for 10, what exactly is going to happen? (I am using TCP
SOCK_STREAM) Does A just pretend that all the byes were sent or does it
block until the receiver receives all the bytes.

I am basically trying to get at the logic that I should be building into my
receiver. If I do not know how much data I am going to receive. What is the
logic I should use at the receiver in determining how many bytes to recv or
read from the byte stream?

I hope someone can help me with this. Thanks a lot!


Barry Margolin

2004-10-02, 9:13 pm

In article <cjj72o$n1u$1@gist.usc.edu>,
"DJP" <dominicjoseph@rediffmail.com> wrote:

> Hi,
>
> I was just trying to understand the send/recv socket calls.


I just answered this in another newsgroup -- please don't multipost.

--
Barry Margolin, barmar@alum.mit.edu
Arlington, MA
*** PLEASE post questions in newsgroups, not directly to me ***
Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com