Boost C++ Libraries of the most highly regarded and expertly designed C++ library projects in the world. Herb Sutter and Andrei Alexandrescu, C++ Coding Standards

Click here to view the latest version of this page.


Return a completion condition function object that indicates that a read or write operation should continue until all of the data has been transferred, or until an error occurs.

unspecified transfer_all();

This function is used to create an object, of unspecified type, that meets CompletionCondition requirements.


Reading until a buffer is full:

boost::array<char, 128> buf;
boost::system::error_code ec;
std::size_t n = boost::asio::read(
    sock, boost::asio::buffer(buf),
    boost::asio::transfer_all(), ec);
if (ec)
  // An error occurred.
  // n == 128