我用这个代码来读读
socket_.async_read_some(boost::asio::buffer(data_, max_length),
boost::bind(&session::handle_read, this,
boost::asio::placeholders::error,
boost::asio::placeholders::bytes_transferred));
和此写作的
boost::asio::async_write(socket_,
boost::asio::buffer(data_, bytes_transferred),
boost::bind(&session::handle_write, this,
boost::asio::placeholders::error));
套接字的位置是套接字,最大长度是数值为1024的圆形,而数据是长度为最大长度的字符阵列。
但我想用溪泡取代字符阵列缓冲。
boost::asio::streambuf streamBuffer;
socket_.async_read_some(boost::asio::buffer(streamBuffer),
boost::bind(&session::handle_read, this,
boost::asio::placeholders::error,
boost::asio::placeholders::bytes_transferred));
但不管用,我该怎么做?