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:SyncReadStream Buffer-oriented synchronous read stream requirements] 9 10A type `X` meets the `SyncReadStream` 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 `ec` denotes an object of type 16`error_code`. 17 18[table SyncReadStream requirements 19 [[operation] [type] [semantics, pre/post-conditions]] 20 [ 21 [`a.read_some(mb)`[br] 22 `a.read_some(mb,ec)`] 23 [`size_t`] 24 [ 25 Meets the requirements for a [link boost_asio.reference.read_write_operations 26 read operation].[br] 27 [br] 28 If `buffer_size(mb) > 0`, reads one or more bytes of data from the stream 29 `a` into the buffer sequence `mb`. If successful, sets `ec` such that 30 `!ec` is `true`, and returns the number of bytes read. If an error 31 occurred, sets `ec` such that `!!ec` is `true`, and returns 0. If all 32 data has been read from the stream, and the stream performed an orderly 33 shutdown, sets `ec` to `stream_errc::eof` and returns 0.[br] 34 [br] 35 If `buffer_size(mb) == 0`, the operation shall not block. Sets `ec` such 36 that `!ec` is `true`, and returns 0. 37 ] 38 ] 39] 40 41[endsect] 42