On Fri, May 25, 2018 at 2:49 PM, Raymond Burkholder via Boost-users < boost-users@lists.boost.org> wrote:
Would it be possible for you to post a modified snippet of your code showing your new way of doing things?
I have changed many things and that wasn't real code. But the easiest way
to transform my example would be to change the header size. I went from
having a CRLF limited line to a 64 bit integer, which I serialize right
into the buffer. This way I always know how large it is and don't need
read_until anymore. Like this:
void read_header_size() {
asio::async_read(m_socket, m_streambuf, asio::transfer_at_least(8),
[self](const boost::system::error_code, const std::size_t) {
// < handle error skipped >
boost::uint64_t header_size = 0;
std::istream is(&self->m_streambuf, std::ios::binary);
is.read(reinterpret_cast