Subject: [Boost-users] [ASIO]what's the meaning of CompletionCondition in boost::asio::async_read?
From: zong jinliang (zongjinliang_at_[hidden])
Date: 2009-11-05 22:04:25


dears,
in function:
       void async_read<file:///F:/boost_1_40_0/doc/html/boost_asio/reference/async_read/overload2.html>
(AsyncReadStream & s,const MutableBufferSequence & buffers,
CompletionCondition completion_condition,ReadHandler handler);
I am puzzled for the variant: "CompletionCondition completion_condition".
take follow code as example:
boost::asio::async_read(socket_,boost::asio::buffer(...),boost::asio::transfer_at_least(1),boost::bind(...));
Before I think it'll return if read 1 bit, but at fact it return until
receive EOF or buffer is full.
So why need this variant? It can return when receive EOF or buffer is full
if there is no this varant, just like:
boost::asio::async_read(socket_,boost::asio::buffer(...),boost::bind(...));