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

This is the documentation for an old version of Boost. Click here to view this page for the latest version.

Buffer-oriented asynchronous read stream requirements

A type X meets the AsyncReadStream requirements if it satisfies the requirements listed below.

In the table below, a denotes a value of type X, mb denotes a (possibly const) value satisfying the MutableBufferSequence requirements, and t is a completion token.

Table 4. AsyncReadStream requirements



semantics, pre/post-conditions


A type satisfying the Executor requirements.

Returns the associated I/O executor.


The return type is determined according to the requirements for an asynchronous operation.

Meets the requirements for a read operation and an asynchronous operation with completion signature void(error_code ec, size_t n).

If buffer_size(mb) > 0, initiates an asynchronous operation to read one or more bytes of data from the stream a into the buffer sequence mb. If successful, ec is set such that !ec is true, and n is the number of bytes read. If an error occurred, ec is set such that !!ec is true, and n is 0. If all data has been read from the stream, and the stream performed an orderly shutdown, ec is stream_errc::eof and n is 0.

If buffer_size(mb) == 0, the operation completes immediately. ec is set such that !ec is true, and n is 0.