title: Listening to an udp broadcast with the boost library
body: <p>Seems to be a problem that many people have, but all the answers I have found so far didn't help.</p>
  
  <p><strong>Problem:</strong>
  I'm trying to listen to a Velodyne HDL32 that sends its packets via UDP to my pc. 
  The OS is 32-bit Ubuntu and Boost library v1.46.</p>
  
  <p>The data i get via Wireshark looks like this:</p>
  
  <pre><code>Time     | Source         | Destination   | Protocol | Length | Source Port | Destination Port
  0.000000 | 192.168.17.212 | 192.168.3.255 | UDP      | 1248   | https       | opentable
  </code></pre>
  
  <p>But with this code, no data is shown to me (Port is correct):</p>
  
  <pre><code>receiver(boost::asio::io_service&amp; io_service,
    const boost::asio::ip::address&amp; listen_address)
  : m_socket(io_service)
  {
  
  boost::asio::ip::address ipAddr = boost::asio::ip::address_v4::any();
  boost::asio::ip::udp::endpoint listen_endpoint(
           ipAddr, 2368);
  
  m_socket.open(listen_endpoint.protocol());
  m_socket.bind(listen_endpoint);
  
  m_socket.async_receive_from(
      boost::asio::buffer(m_data, max_length), m_sender_endpoint,
      boost::bind(&amp;receiver::handle_receive_from, this,
        boost::asio::placeholders::error,
        boost::asio::placeholders::bytes_transferred));
  }
  
  void handle_receive_from(const boost::system::error_code&amp; error,
    size_t bytes_recvd)
  {
  std::cout &lt;&lt; "receive" &lt;&lt; bytes_recvd &lt;&lt; std::endl;
  
  
    m_socket.async_receive_from(
        boost::asio::buffer(m_data, max_length), m_sender_endpoint,
        boost::bind(&amp;receiver::handle_receive_from, this,
          boost::asio::placeholders::error,
          boost::asio::placeholders::bytes_transferred));
  }
  </code></pre>
  
  <p>Can anyone identify a problem so far or do you need more information?
  I appreciate any help I can get.</p>
  
  <p><strong>NOTE:</strong>
  I'm NOT running the program with root privileges!</p>
  
  <p><strong>Some thoughts:</strong>
  Could it be possible that boost::asio::ip::address_v4::any() won't listen to the IP <em>.</em>.*.255 when having subnetmask 255.255.255.0?</p>
  
  <p>When using netcat, no data is shown as well. When I use Windows netcat it works quite fine. Same with Wireshark on Linux and Windows - works fine.
  Tried it with the  as well, but with the same effect - no data.</p>