title: boost::asio UDP broadcasting
body: <p>I want to broadcast UDP messages to all computers in a local network using <code>boost::asio</code>. Working through the examples I came up with </p>
  
  <pre><code>try {
      socket.open(boost::asio::ip::udp::v4());
      boost::asio::socket_base::broadcast option(true);
      socket.set_option(option);
      endpoint = boost::asio::ip::udp::endpoint(
          boost::asio::ip::address::from_string("192.168.1.255"),
          port);
  }
  catch(std::exception &amp;e) {
  }
  </code></pre>
  
  <p>and want to broadcast messages from my queue with</p>
  
  <pre><code>while(!queue.empty()) {
      std::string message = queue.front();
      boost::system::error_code ignored_error;
      socket.send_to(
          boost::asio::buffer(message),
          endpoint,
          0, ignored_error);
      queue.pop_front();
  }
  </code></pre>
  
  <p>but my code throws an exception <code>invalid argument</code> exception in the first code block. It works fine for <code>127.0.0.1</code> though. What am I doing wrong?</p>