Boost logo

Boost Users :

Subject: Re: [Boost-users] asio::transfer_at_least strange behavior
From: Igor R (boost.lists_at_[hidden])
Date: 2009-02-12 14:16:47


>
> Is transfer_at_least supposed to return success only if requested number of
> bytes transferred at once or at all?
>

http://www.boost.org/doc/libs/1_37_0/doc/html/boost_asio/reference/transfer_at_least.html
"Return a completion condition function object that indicates that a read or
write operation **should continue until** a minimum number of bytes has been
transferred, or until an error occurs."

> For example, I want to receive 800 bytes and put them into streambuf using
> transfer_at_least(800) as completion condition, but I receive 2 chunks of
> 400 bytes, therefore I never get a success, because transfer_at_least_t
> always wants more data.

When 800 bytes are received (at once or by chunks) or error occurs, the
completion handler is invoked - that's the effect of this completion
condition. If you encounter different behaviour, could you please provide
minimal code demonstrating this?



Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net