Boost logo

Boost Users :

Subject: [Boost-users] [asio] Reading datagram packets
From: Chard (boost_at_[hidden])
Date: 2009-01-22 17:40:13


Is it possible to read the extra data that wasn't added to the buffer when a datagram is received ?

E.g. given an initial receive instruction something like:

  char m_buf[10];
  udp::endpoint m_endpoint;
<-->
  udpSocket.async_receive_from(buffer(buf), m_endpoint, bind(ReadHandler, ...));
  service.run();
 
If more than 10 characters were in the datagram packet, how can they be accessed?
Calling other read methods (after processing in the ReadHandler) just appears to block (I guess it is looking for another packet).

Surely I don't have to ensure the buffer is as large as I'll ever need it to be?



Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net