title: How does Boost ASIO receive_from return underlying socket errors?
body: <p>i.e. will the blocking version return -1 on error.</p>
  
  <p>Or more to the point, how do you know the call failed?  does</p>
  
  <p>boost::asio::ip::udp::socket::receive_from() return -1 on error</p>
  
  <p>The normal BSD socket API receive_from call will return -1 on errors and you can look at errno for the specific error code.  Does the boost version do the same?</p>
  
  <p>Ok, I tried passing the overload like this: </p>
  
  <pre><code>while(true){
      boost::system::error_code ec;
      size_t length = socket_.receive_from(
          boost::asio::buffer(buffer, buffer_size), 
          sender_endpoint, ec);
  
      /// ... other code
  }
  </code></pre>
  
  <p>But I get this error on compilation:</p>
  
  <pre><code>error: no matching function for call to ‘boost::asio::basic_datagram_socket&lt;boost::asio::ipdp, boost::asio::datagram_socket_service&lt;boost::asio::ip::udp&gt; &gt;::receive_from(boost::asio::mutable_buffer, boost::asio::ip::basic_endpoint&lt;boost::asio::ip::udp&gt;&amp;, boost::system::error_code&amp;)’
  make: *** [server.o] Error 1
  </code></pre>
  
  <p>Is the documentation wrong or am I doing something wrong?
  EDIT: no I'm wrong... sorry I'm having a moment... it's called overwork! I'm half asleep right now.  I'm missing the flags argument.</p>