|
|
Newbie question about recv() function
Setup: TCP/IP
Model: Multi-threaded server / many clients
Remarks: Both server and client use recv() and send() functions with
flag set to 0. Server does a select() on client's socket descriptors.
Question: Suppose server and client send() at the same time, and once
they have done that, server and client are blocked on recv(), would the
message previously sent be missed by the server and/or client or would
they be stored in some sort of buffer which would be read and cleared
when client/server do the recv()?
|
|
0
|
|
|
|
Reply
|
shivesh (11)
|
4/7/2005 8:57:03 PM |
|
In article <1112907423.042284.29040@o13g2000cwo.googlegroups.com>,
shivesh@gmail.com wrote:
> Setup: TCP/IP
> Model: Multi-threaded server / many clients
> Remarks: Both server and client use recv() and send() functions with
> flag set to 0. Server does a select() on client's socket descriptors.
>
> Question: Suppose server and client send() at the same time, and once
> they have done that, server and client are blocked on recv(), would the
> message previously sent be missed by the server and/or client or would
> they be stored in some sort of buffer which would be read and cleared
> when client/server do the recv()?
Send and receive don't interfere with each other. The data is stored in
buffers, and there are separate send and receive buffers.
--
Barry Margolin, barmar@alum.mit.edu
Arlington, MA
*** PLEASE post questions in newsgroups, not directly to me ***
|
|
0
|
|
|
|
Reply
|
Barry
|
4/7/2005 10:51:15 PM
|
|
|
1 Replies
206 Views
(page loaded in 2.184 seconds)
|
|
|
|
|
|
|
|
|