I'm sending an ordered sequence of datagram from a server to client in C UNIX. I'm using Berkeley' sockets. The server has a counter that is incremented when a datagram is sent. Each datagram contains this counter as data value. So client read a sequence of datagrams where each datagram has the order number inside its data field.
Server and client are on the same machine so I'm using UDP on LOCALHOST.
The problem is that I lose packets.
In fact, when I'm reading the value of these datagrams I can't find some numbers. It's possible that UDP loses packet in localhost? I'm sending 10000 datagrams overall, but I can see the problem usually early. Already around 150 packages I often experience losses.
Wireshark can see the losses datagrams. Why my client not? where do they end up? If I lose packets I think that also Wireshark can't see these packets. But in my case, Wireshark sees all ok every time.