Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
Update RunLoop/AsyncUdpSocket.m #49
Found a pretty bad bug. The queues aren't safe because you can potentially remove objects at position 0 (dequeuing) at the same time you're adding objects. The solution is to put in a lock whenever you manipulate the queue. This got rid of consistent crashes for me.
So I've added NSLock objects theSendQueueLock and theReceiveQueueLock. (Note you'll need to declare them in the corresponding AsyncUdpSocket.h).
This is the only part of the library I'm actually using, so I don't know how pervasive this queuing problem is.