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:AsyncWriteStream Buffer-oriented asynchronous write stream requirements]
9
10A type `X` meets the `AsyncWriteStream` 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 `t` is a completion token.
16
17[table AsyncWriteStream 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_write_some(cb,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      write 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(cb) > 0`, initiates an asynchronous operation to write
37      one or more bytes of data to the stream `a` from the buffer sequence
38      `cb`. If successful, `ec` is set such that `!ec` is `true`, and `n` is
39      the number of bytes written. If an error occurred, `ec` is set such that
40      `!!ec` is `true`, and `n` is 0.[br]
41      [br]
42      If `buffer_size(cb) == 0`, the operation completes immediately. `ec` is
43      set such that `!ec` is `true`, and `n` is 0.
44    ]
45  ]
46]
47
48[endsect]
49