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:SyncWriteStream Buffer-oriented synchronous write stream requirements]
9
10A type `X` meets the `SyncWriteStream` requirements if it satisfies the
11requirements listed below.
12
13In the table below, `a` denotes a value of type `X`, `cb` denotes a (possibly
14const) value satisfying the [link boost_asio.reference.ConstBufferSequence
15`ConstBufferSequence`] requirements, and `ec` denotes an object of type
16`error_code`.
17
18[table SyncWriteStream requirements
19  [[operation] [type] [semantics, pre/post-conditions]]
20  [
21    [`a.write_some(cb)`[br]
22     `a.write_some(cb,ec)`]
23    [`size_t`]
24    [
25      Meets the requirements for a [link boost_asio.reference.read_write_operations
26      write operation].[br]
27      [br]
28      If `buffer_size(cb) > 0`, writes one or more bytes of data to the stream
29      `a` from the buffer sequence `cb`. If successful, sets `ec` such that
30      `!ec` is `true`, and returns the number of bytes written. If an error
31      occurred, sets `ec` such that `!!ec` is `true`, and returns 0.[br]
32      [br]
33      If `buffer_size(cb) == 0`, the operation shall not block. Sets `ec` such
34      that `!ec` is `true`, and returns 0.
35    ]
36  ]
37]
38
39[endsect]
40