GCDAsyncUdpSocket deletes packets and creates many DISPATCH_WORKER_THREADs

I am creating a multicast client with GCDAsyncUdpSocketand I am faced with a lot of packet loss.

I tracked the server with Wireshark, and also captured WiFi packets in AirCap air, and I'm sure the packets are being sent correctly. I also looked at the debug trace from the library GCDAsyncUdpSocket, and I see that sometimes it is socket4FDBytesAvailable:called with a large argument, for example 4000, but when it reads the socket, it reads fewer bytes - maybe 500 - and that where the packets get lost. I have increased the socket buffer, but this does not help.

Finally, I noticed the use of the Time profiler that, whether it is a match or not, every time I lose packets, one new instance of DISPATCH_WORKER_THREAD is created. This is normal?

+5
source share

All Articles