How to set ReceiveBufferSize for UDPClient? or Does it make sense to set? C#
Posted
by Jack
on Stack Overflow
See other posts from Stack Overflow
or by Jack
Published on 2010-03-08T15:30:13Z
Indexed on
2010/03/08
15:51 UTC
Read the original article
Hit count: 296
Hello all.
I am implementing a UDP data transfer thing. I have several questions about UDP buffer.
I am using UDPClient to do the UDP send / receive. and my broadband bandwidth is 150KB/s (bytes/s, not bps).
I send out a 500B datagram out to 27 hosts
27 hosts send back 10KB datagram back if they receive.
So, I should receive 27 responses, right? however, I only get averagely 8 - 12 instead.
I then tried to reduce the size of the response down to 500B, yes, I receive all.
A thought of mine is that if all 27 hosts send back 10KB response at almost same time, the incoming traffic will be 270KB/s (likely), that exceeds my incoming bandwidth so loss happens. Am I right?
But I think even if the incoming traffic exceeds the bandwidth, is the Windows supposed to put the datagram in the buffer and wait for receive?
I then suspect that maybe the ReceiveBufferSize of my UdpClient is too small? by default, it is 8092B??
I don't know whether I am all right at these points. Please give me some help.
© Stack Overflow or respective owner