I have a C# UDP socket hosted on azure cloud that receives UDP datagrams using UdpClient.receive
. There could be thousands of clients sending messages to the socket concurrently and each client sends datagrams with a size of around 1Kb.
I am confused to whether the ReceiveBufferSize
applies to the size of each datagram or if it sets the size of the receive queue underneath? By receive queue, I mean the queue that is used by the .NET runtime to enqueue datagrams from different clients that hasn't been read by UdpClient.receive
yet.
I read in some posts that the ReceiveBufferSize
only applies to the size of individual datagrams, if that's the case, how would we set the size of the receive queue underneath?
I have set the ReceiveBufferSize
to 65Kb. If the ReceiveBufferSize
applies to the queue size under the hood, and each client sends a 1Kb datagram at the same time, does this mean the socket can only handle data from 65 clients? If there are more clients sending at the same time the buffer overflows and datagrams are lost?