]>
Commit | Line | Data |
---|---|---|
7c673cae FG |
1 | [/ |
2 | / Copyright (c) 2003-2016 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 | ||
10 | In the table below, `a` denotes a synchronous read stream object, `mb` denotes | |
11 | an object satisfying [link boost_asio.reference.MutableBufferSequence | |
12 | mutable buffer sequence] requirements, and `ec` denotes an object of type | |
13 | `error_code`. | |
14 | ||
15 | [table Buffer-oriented synchronous read stream requirements | |
16 | [[operation] [type] [semantics, pre/post-conditions]] | |
17 | [ | |
18 | [`a.read_some(mb);`] | |
19 | [`size_t`] | |
20 | [Equivalent to: | |
21 | `` | |
22 | error_code ec; | |
23 | size_t s = a.read_some(mb, ec); | |
24 | if (ec) throw system_error(ec); | |
25 | return s; | |
26 | ``] | |
27 | ] | |
28 | [ | |
29 | [`a.read_some(mb, ec);`] | |
30 | [`size_t`] | |
31 | [ | |
32 | Reads one or more bytes of data from the stream `a`.\n | |
33 | \n | |
34 | The mutable buffer sequence `mb` specifies memory where the data should | |
35 | be placed. The `read_some` operation shall always fill a buffer in the | |
36 | sequence completely before proceeding to the next.\n | |
37 | \n | |
38 | If successful, returns the number of bytes read and sets `ec` such that | |
39 | `!ec` is true. If an error occurred, returns `0` and sets `ec` such that | |
40 | `!!ec` is true.\n | |
41 | \n | |
42 | If the total size of all buffers in the sequence `mb` is `0`, the | |
43 | function shall return `0` immediately. | |
44 | ] | |
45 | ] | |
46 | ] | |
47 | ||
48 | [endsect] |