Trying to limit number of bytes transferred to at least 15 bytes before
async_read call back
I have got callbacks with sizes:
0,1,2,3,4 and 5 (so total indeed 15)
But I was expecting only single callback with size 15.
How I can fix the issue?
Thanks Vlad.
linux suse 2.6.16 boost 1.39 gcc 4.1.2
//boost asio stripped part.
BufferSize=1000;
class test{
vector<char> read_buffer_;
boost::asio::ip::tcp::socket socket_; //socket was inited correctly.
test() {
read_buffer_.reserve(BufferSize);
}
void handle_connect( const boost::system::error_code& err,
boost::asio::ip::tcp::resolver::iterator endpoint_iterator )
{
if (!err) {
boost::asio::async_read(socket_,boost::asio::buffer(read_buffer_,
BufferSize),
//requested at least 15 bytes!!
boost::asio::transfer_at_least(15),
boost::bind(&test::handle_read, this,
boost::asio::placeholders::error));
}
else {
cerr<