12-21-05 10:57 PM
<girishdkale@yahoo.com> wrote in message
news:1135163437.309936.28000@g44g2000cwa.googlegroups.com...
> If the buffer is not full, will it block?
If you are using a blocking socket, it can block for as long as it
likes. In practice, it will block until the kernel buffer is not full. If
data is being sent faster than it is being received, eventually the buffer
will fill up and the sender will not be allowed to run faster than the
receiver.
> We tried to send 70 messages from App A to App B, with the above given
> kernel parameters. In App B there we put a sleep of 2 secs after it
> receives this message from App A. Observation is that the App A also
> waits for 2 secs before it sends the next message.
Imagine if the buffer is big enough to hold 30 messages and you are
sending a message every second but only receiving one every two seconds.
After 30 seconds, the sender will be blocked for a second, guaranteed. After
that, the sender will be blocked so that it runs no faster than the
receiver.
This is true for any fixed buffer size, so long as the sender sends data
faster than the receiver receives it.
DS
[ Post a follow-up to this message ]
|