title: Boost Asio UDP server set socket to listen on specified IP
body: <p>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.</p>
  
  <pre><code>std::unique_ptr&lt;boost::asio::ip::udp::socket&gt; socketUDP;    
  socketUDP.reset(new udp::socket(io_serviceUDP, udp::endpoint(udp::v4(), 9999)));
  </code></pre>
  
  <p>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)</p>
  
  <pre><code>socketUDP.reset(new udp::socket(m_io_serviceUDP, udp::endpoint(asio::ip::address::from_string("169.254.1.2"), 9999)));
  </code></pre>
  
  <p><strong>Please note :</strong> 
  <strong>1)</strong> According to the answer for : <a href="https://stackoverflow.com/questions/16971405/issue-with-broadcast-using-boost-asio">Issue with broadcast using Boost.Asio</a> this should actually work. Of course my understanding isn't quite correct as I'm missing something</p>
  
  <p><strong>2)</strong> The provided IP is valid, works, sends data(confirmed by wireshark) and can be pinged</p>