AsyncWriteStream.qbk 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. [/
  2. / Copyright (c) 2003-2019 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. [section:AsyncWriteStream Buffer-oriented asynchronous write stream requirements]
  8. A type `X` meets the `AsyncWriteStream` requirements if it satisfies the
  9. requirements listed below.
  10. In the table below, `a` denotes a value of type `X`, `cb` denotes a (possibly
  11. const) value satisfying the [link boost_asio.reference.ConstBufferSequence
  12. `ConstBufferSequence`] requirements, and `t` is a completion token.
  13. [table AsyncWriteStream requirements
  14. [[operation] [type] [semantics, pre/post-conditions]]
  15. [
  16. [`a.get_executor()`]
  17. [A type satisfying the [link boost_asio.reference.Executor1 Executor requirements].]
  18. [Returns the associated I/O executor.]
  19. ]
  20. [
  21. [`a.async_write_some(cb,t)`]
  22. [
  23. The return type is determined according to the requirements for an
  24. [link boost_asio.reference.asynchronous_operations asynchronous operation].
  25. ]
  26. [
  27. Meets the requirements for a [link boost_asio.reference.read_write_operations
  28. write operation] and an [link boost_asio.reference.asynchronous_operations
  29. asynchronous operation] with completion signature `void(error_code ec,
  30. size_t n)`.\n
  31. \n
  32. If `buffer_size(cb) > 0`, initiates an asynchronous operation to write
  33. one or more bytes of data to the stream `a` from the buffer sequence
  34. `cb`. If successful, `ec` is set such that `!ec` is `true`, and `n` is
  35. the number of bytes written. If an error occurred, `ec` is set such that
  36. `!!ec` is `true`, and `n` is 0.\n
  37. \n
  38. If `buffer_size(cb) == 0`, the operation completes immediately. `ec` is
  39. set such that `!ec` is `true`, and `n` is 0.
  40. ]
  41. ]
  42. ]
  43. [endsect]