On Thu, May 24, 2018 at 10:49 AM, Stephan Menzel via Boost-users
This pretty much means taking over what asio calls 'composed operations'
You don't have to write a composed operation and accompanying initiating function, you can do this right in the code you already have. Just replace `async_read_until` with `stream.async_read_some` and put that in a loop.
...I always folded when it came to inspecting the contents of a streambuf. I simply don't know how this can be done.
There are a few approaches. The easiest solution is to convert the readable bytes of the stream buffer to a pair of iterators using these asio utility functions, and apply std algorithms (or your own) to that range: https://www.boost.org/doc/libs/1_67_0/doc/html/boost_asio/reference/buffers_... https://www.boost.org/doc/libs/1_67_0/doc/html/boost_asio/reference/buffers_... If you are using Boost.Asio 1.67, you can adapt a std::string into a dynamic buffer using dynamic_string_buffer: https://www.boost.org/doc/libs/1_67_0/doc/html/boost_asio/reference/dynamic_... Once you have the message in a std::string it should be pretty straightforward to use string algorithms on it. Hope this helps!