1[/ 2 / Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com) 3 / 4 / Distributed under the Boost Software License, Version 1.0. (See accompanying 5 / file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 6 /] 7 8[section:AsyncReadStream Buffer-oriented asynchronous read stream requirements] 9 10A type `X` meets the `AsyncReadStream` requirements if it satisfies the 11requirements listed below. 12 13In the table below, `a` denotes a value of type `X`, `mb` denotes a (possibly 14const) value satisfying the [link boost_asio.reference.MutableBufferSequence 15`MutableBufferSequence`] requirements, and `t` is a completion token. 16 17[table AsyncReadStream requirements 18 [[operation] [type] [semantics, pre/post-conditions]] 19 [ 20 [`a.get_executor()`] 21 [A type satisfying the [link boost_asio.reference.Executor1 Executor requirements].] 22 [Returns the associated I/O executor.] 23 ] 24 [ 25 [`a.async_read_some(mb,t)`] 26 [ 27 The return type is determined according to the requirements for an 28 [link boost_asio.reference.asynchronous_operations asynchronous operation]. 29 ] 30 [ 31 Meets the requirements for a [link boost_asio.reference.read_write_operations 32 read operation] and an [link boost_asio.reference.asynchronous_operations 33 asynchronous operation] with completion signature `void(error_code ec, 34 size_t n)`.[br] 35 [br] 36 If `buffer_size(mb) > 0`, initiates an asynchronous operation to read one 37 or more bytes of data from the stream `a` into the buffer sequence `mb`. 38 If successful, `ec` is set such that `!ec` is `true`, and `n` is the 39 number of bytes read. If an error occurred, `ec` is set such that `!!ec` 40 is `true`, and `n` is 0. If all data has been read from the stream, and 41 the stream performed an orderly shutdown, `ec` is 42 `stream_errc::eof` and `n` is 0.[br] 43 [br] 44 If `buffer_size(mb) == 0`, the operation completes immediately. `ec` is 45 set such that `!ec` is `true`, and `n` is 0. 46 ] 47 ] 48] 49 50[endsect] 51