Boost  v1.57.0
doxygen for www.boost.org
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Completion Condition Function Objects

Function objects used for determining when a read or write operation should complete. More...

Functions

detail::transfer_all_t boost::asio::transfer_all ()
 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. More...
 
detail::transfer_at_least_t boost::asio::transfer_at_least (std::size_t minimum)
 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. More...
 
detail::transfer_exactly_t boost::asio::transfer_exactly (std::size_t size)
 Return a completion condition function object that indicates that a read or write operation should continue until an exact number of bytes has been transferred, or until an error occurs. More...
 

Detailed Description

Function objects used for determining when a read or write operation should complete.

Function Documentation

detail::transfer_all_t boost::asio::transfer_all ( )
inline

#include <boost_1_57_0/boost/asio/completion_condition.hpp>

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.

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

Example
Reading until a buffer is full:
std::size_t n = boost::asio::read(
sock, boost::asio::buffer(buf),
if (ec)
{
// An error occurred.
}
else
{
// n == 128
}
detail::transfer_at_least_t boost::asio::transfer_at_least ( std::size_t  minimum)
inline

#include <boost_1_57_0/boost/asio/completion_condition.hpp>

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.

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

Example
Reading until a buffer is full or contains at least 64 bytes:
std::size_t n = boost::asio::read(
sock, boost::asio::buffer(buf),
if (ec)
{
// An error occurred.
}
else
{
// n >= 64 && n <= 128
}
detail::transfer_exactly_t boost::asio::transfer_exactly ( std::size_t  size)
inline

#include <boost_1_57_0/boost/asio/completion_condition.hpp>

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

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

Example
Reading until a buffer is full or contains exactly 64 bytes:
std::size_t n = boost::asio::read(
sock, boost::asio::buffer(buf),
if (ec)
{
// An error occurred.
}
else
{
// n == 64
}