I have a relatively simple, server-to-many client setup. The server is sending out datagrams using multicast, and the (potentially many) clients receive them.
The Linux (RHEL) clients are receiving/reading an approximately 3-4 Mbps stream of these datagrams, using:
QByteArray datagram;
while (udpSocketReceiver->hasPendingDatagrams())
{
datagram.resize(udpSocketReceiver->pendingDatagramSize());
udpSocketReceiver->readDatagram(datagram.data(), datagram.size());
}
This seems to work probably 99.99% of the time. However, I am occasionally seeing that a datagram gets missed (as observed by internal counters/schema that I'm using). My first thought was "well, it's UDP - it must just be getting dropped in transmission."
However, I'm also monitoring the client/receiver side using tcpdump ... and I'm also seeing the "missing" datagrams present there, that are missed by the application. It would seem that the missed datagrams are being received by the network interface just fine, but I'm occasionally dropping them coming into the application layer. Just about the last place I'd expect to be dropping them.
I've been playing around with adjusting applicable buffers in Linux (net.core.rmem_max, net.core.rmem_default), but without any luck.
Thanks for any help.