When I'm working on a UDP server I usually set the socket to listen on specified port and accept any IP. Keep in mind that sync receive works properly here.
std::unique_ptr<boost::asio::ip::udp::socket> socketUDP;
socketUDP.reset(new udp::socket(io_serviceUDP, udp::endpoint(udp::v4(), 9999)));
However, I would really like to have 2 different server applications listening at the same port (9999) but accepting only a single IP (I already know that IP). Each of the apps has its own client with its own IP. But for some reason the following doesn't work (not receiving any packets in the app, while Wireshark can see it)
socketUDP.reset(new udp::socket(m_io_serviceUDP, udp::endpoint(asio::ip::address::from_string("169.254.1.2"), 9999)));
Please note : 1) According to the answer for : Issue with broadcast using Boost.Asio this should actually work. Of course my understanding isn't quite correct as I'm missing something
2) The provided IP is valid, works, sends data(confirmed by wireshark) and can be pinged