21 Feb
2009
21 Feb
'09
12:18 a.m.
executing this code: boost::asio::streambuf b; std::cout << "socket.available()=" << socket.available() << std::endl; size_t received = boost::asio::read_until(socket, b, "\r\n"); std::cout << "received=" << received << std::endl; std::cout << "b.size()=" << b.size() << std::endl; std::istream is(&b); std::getline(is, m_token); results in output of: socket.available()=34 received=26 b.size()=34 In my app I need to read the 8 bytes (after the 26) as binary (and hence don't use the streambuf to do so). Yet read_until has already consumed them from the socket and placed them in the streambuf :( Suggestions?