title: Boost.ASIO UDP socket: sink all the packets
body: <p>I'm using the boost::asio::ip::udp::socket to receive UDP packets via socket's async_receive_from method.</p>
  
  <p>The code works fine, the only problem is that in the time I process a packet, lots more come creating a queue (the buffer) to process. My program though must sink all the packets received since the start of the processing, so that it listens only to the most recent ones.</p>
  
  <p>Example:</p>
  
  <ul>
  <li>packet 1 is sent</li>
  <li>packet 1 is being processed</li>
  <li>packets 2, 3, 4 are sent</li>
  <li>packet 1 ends the computation</li>
  <li><strong>flush the buffer</strong></li>
  <li>packet 5 is sent</li>
  <li>packet 5 is being processed</li>
  <li>etc</li>
  </ul>
  
  <p>Is there any way to discard the packets in the middle?
  Thanks!</p>