AsyncReadStream.qbk 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  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:AsyncReadStream Buffer-oriented asynchronous read stream requirements]
  8. A type `X` meets the `AsyncReadStream` requirements if it satisfies the
  9. requirements listed below.
  10. In the table below, `a` denotes a value of type `X`, `mb` denotes a (possibly
  11. const) value satisfying the [link boost_asio.reference.MutableBufferSequence
  12. `MutableBufferSequence`] requirements, and `t` is a completion token.
  13. [table AsyncReadStream 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_read_some(mb,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. read 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(mb) > 0`, initiates an asynchronous operation to read one
  33. or more bytes of data from the stream `a` into the buffer sequence `mb`.
  34. If successful, `ec` is set such that `!ec` is `true`, and `n` is the
  35. number of bytes read. If an error occurred, `ec` is set such that `!!ec`
  36. is `true`, and `n` is 0. If all data has been read from the stream, and
  37. the stream performed an orderly shutdown, `ec` is
  38. `stream_errc::eof` and `n` is 0.\n
  39. \n
  40. If `buffer_size(mb) == 0`, the operation completes immediately. `ec` is
  41. set such that `!ec` is `true`, and `n` is 0.
  42. ]
  43. ]
  44. ]
  45. [endsect]