I need to write a UDP listener that will require an endpoint which can receive and respond to multiple remote endpoints. My biggest problem is how this functionality maps to the connection-oriented APIs in Network framework.
As I understand it, there are 3 key elements to work out:
Create a connection to each remote host I wish to exchange data with. How do I specify that I want to use the same UDP "socket" for them -- just pass the same local address (after enabling reuse)?
Install a listener callback, to accept new packets / connections as they come in.
How should these be scheduled -- can I just keep them all on the same queue?
I've found a few pieces of sample code for using UDP (netcat, WWDC camera demo), but invariably they assume that there will only be one peer. Any strategies for managing the number of connections, and dependencies in between, would be helpful.