My program uses UdpClient to try to get 27 responses from 27 hosts. The response size is 10 KB. My broadband inbound bandwidth is 150KB / s.
27 responses are sent from hosts almost simultaneously and every 10 seconds.
However, I can only get 8 to 17 responses each time. The number of answers I can get is quite dynamic, but within the range.
Can someone tell me why? why can't i get everything?
I understand that UDP is not reliable. but I tried to get 5 to 10 answers at the same time, it worked. I think network links are not so bad.
The code is very simple. On 27 hosts, I just use UdpClient to send 10K to my machine.
On my machine, I have one UdpClient that receives datagrams. Every time I get data, I create a stream to process it (basically processing means just printing "I got 10 KB", but it works in the stream).
listener = new UDPListener(Port); listener.Start(); while (true) { try { UDPContext context = listener.Accept(); ThreadPool.QueueUserWorkItem(new WaitCallback(HandleMessage), context); } catch (Exception) { } }
If I reduce the response size to 3 KB, the situation will be much better than about 25 answers.
Any other idea? UDP buffer issues
source share