Boost logo

Boost Users :

Subject: [Boost-users] Asio streambuf
From: James Barlow-Bignell (james_at_[hidden])
Date: 2012-02-04 19:05:28


Hiya,

 

Does anyone know a way of reading from an asio::streambuf without removing
the bytes?

 

I'm using async_read() to get (possibly several) TCP messages, where each
message is prefixed with a size field. If I can read the size without
removing it from the buffer, I can check whether all the data was received
and leave the size intact for the next handler if not.

 

Any advice appreciated.

 

Cheers,

James



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