I am not really sure what response_stream is, but I see what you are trying
to do. Consider doing the following instead:
void Client::handle_read(boost::asio::ip::tcp::socket* socket, const
boost::system::error_code& err, size_t bytes_transferred)
{
...
//Note: data, will contain the "ok\r\n".. so just do some string manip to
get rid of it
const char* data=boost::asio::buffer_cast
On 10/12/2009 12:17, Igor R wrote:
Because just before, the 2 bytes of "ok" are consumed by response_stream.read(response_char, message_size) ; I assume that this read() call consume them, no ? No.
I tried to consume the amount of bytes transferred (4 in this case), without success. What makes me think that my problem is stream-related is that when I don't try to read the answer from the server, I successful close the socket , reconnect, and repeat the process without problem.
_______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users
-- View this message in context: http://old.nabble.com/-ASIO--Wrong-usage-of-streambuf---tp26695276p26731226.... Sent from the Boost - Users mailing list archive at Nabble.com.