Boost logo

Boost Users :

Subject: Re: [Boost-users] transfer_at_least_t
From: Igor R (boost.lists_at_[hidden])
Date: 2011-11-01 06:04:49


Hi,

> I have an object of transfer_at_least_t.  I would like to find out what the minimum value is due to the fact that my app that set it is  requiring so many bytes of unencrypted data, and the transfer is including the encryption.

I'm not sure I understand the above sentence, but anyway - a
completion condition is just a functor with the following operator()
signature:
template <typename Error>
std::size_t operator()(const Error& err, std::size_t bytes_transferred);
It accepts the number of bytes that have already been transferred, and
must return the maximum number of bytes to be transferred. Standard
completion conditions do not provide any other interfaces.
But you can add to your own completion condition whatever interfaces
you want, make it "stateful" etc. Note however that this functor might
get copied, so updating & reading its state could be a bit tricky.

(BTW, it's worth mentioting in the message title that you mean asio library).


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