Understanding socket calls send() and recv()
From: Rookie (dominicjoseph_at_rediffmail.com)
Date: 10/14/04
- Next message: Barry Margolin: "Re: Understanding socket calls send() and recv()"
- Previous message: Beardy: "Re: Possible to get CPU time used for a process that has not exited?"
- Next in thread: Barry Margolin: "Re: Understanding socket calls send() and recv()"
- Reply: Barry Margolin: "Re: Understanding socket calls send() and recv()"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Wed, 13 Oct 2004 17:32:43 -0700
Hi,
I had a question about send() and recv() calls. Suppose A and B have
established a connection (TCP sockets). Now if A send()s data to B, but at
that moment B is busy doing something else. Once B completes its task it
executes a recv() - will this let B get the data that A send? Or is it
absolutely essential that B be ready to recv() data when A sends it?
My understanding is that the incoming data is stored in a buffer on B's
machine and when the application (B in this case) does a recv(), this data
is then given to the application from the buffer. Correct me if I am wrong.
However if this understanding is correct then if a sender (A) is constantly
sending, I guess it will cause a buffer overflow at B - does TCP handle this
by asking the sender not to send anymore data or do we have to handle this
in the application? Also what is this buffer size? Is there any way to
programmatically set it?
I hope to hear from someone on this, soon. Thanks!
- Next message: Barry Margolin: "Re: Understanding socket calls send() and recv()"
- Previous message: Beardy: "Re: Possible to get CPU time used for a process that has not exited?"
- Next in thread: Barry Margolin: "Re: Understanding socket calls send() and recv()"
- Reply: Barry Margolin: "Re: Understanding socket calls send() and recv()"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|