Reputation: 21
If you have two udp sockets, with the same port, and only one of them is set up to only receive messages from an specific ip, i know that a message will be delivered randomly to one of them, but if both are set up to only receive messages from different ips, with connect, does any message get lost because they will be sent to the wrong socket and discarded?
Upvotes: 2
Views: 663
Reputation: 123531
A connected UDP socket will only receive datagrams from the connected peer. This is also true if there are two sockets bound to the same address (IP and port) but connected to different peers. Thus, in your case, no messages will end up at the wrong socket and get lost there.
Upvotes: 3