From: "Igor R"
Suggestions?
For the both readings use the same buffer - either streambuf or any other.
Yea, I figured that might be the case, but also means I can't use boost::asio::read_until for this purpose. I mistakenly thought that: boost::asio::streambuf b; boost::asio::read_until(socket, b, "\r\n"); would actually STOP consuming from the socket when it got the "\r\n" ... The documentation seems to imply this: "This function is used to read data into the specified streambuf *until* the streambuf's get area contains the specified delimiter." (emphasis on *until* mine) In reality it will read more than that into the streambuf ... I'm reworking my implementation to have my own buffer (not streambuf based) and then implement my own "read_until" ...