1<html> 2<head> 3<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> 4<title>Buffer-oriented asynchronous read stream requirements</title> 5<link rel="stylesheet" href="../../../../doc/src/boostbook.css" type="text/css"> 6<meta name="generator" content="DocBook XSL Stylesheets V1.79.1"> 7<link rel="home" href="../../boost_asio.html" title="Boost.Asio"> 8<link rel="up" href="../reference.html" title="Reference"> 9<link rel="prev" href="AsyncRandomAccessWriteDevice.html" title="Buffer-oriented asynchronous random-access write device requirements"> 10<link rel="next" href="AsyncWriteStream.html" title="Buffer-oriented asynchronous write stream requirements"> 11</head> 12<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"> 13<table cellpadding="2" width="100%"><tr> 14<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../boost.png"></td> 15<td align="center"><a href="../../../../index.html">Home</a></td> 16<td align="center"><a href="../../../../libs/libraries.htm">Libraries</a></td> 17<td align="center"><a href="http://www.boost.org/users/people.html">People</a></td> 18<td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td> 19<td align="center"><a href="../../../../more/index.htm">More</a></td> 20</tr></table> 21<hr> 22<div class="spirit-nav"> 23<a accesskey="p" href="AsyncRandomAccessWriteDevice.html"><img src="../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../reference.html"><img src="../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../boost_asio.html"><img src="../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="AsyncWriteStream.html"><img src="../../../../doc/src/images/next.png" alt="Next"></a> 24</div> 25<div class="section"> 26<div class="titlepage"><div><div><h3 class="title"> 27<a name="boost_asio.reference.AsyncReadStream"></a><a class="link" href="AsyncReadStream.html" title="Buffer-oriented asynchronous read stream requirements">Buffer-oriented 28 asynchronous read stream requirements</a> 29</h3></div></div></div> 30<p> 31 A type <code class="computeroutput">X</code> meets the <code class="computeroutput">AsyncReadStream</code> requirements 32 if it satisfies the requirements listed below. 33 </p> 34<p> 35 In the table below, <code class="computeroutput">a</code> denotes a value of type <code class="computeroutput">X</code>, 36 <code class="computeroutput">mb</code> denotes a (possibly const) value satisfying the <a class="link" href="MutableBufferSequence.html" title="Mutable buffer sequence requirements"><code class="computeroutput">MutableBufferSequence</code></a> 37 requirements, and <code class="computeroutput">t</code> is a completion token. 38 </p> 39<div class="table"> 40<a name="boost_asio.reference.AsyncReadStream.t0"></a><p class="title"><b>Table 4. AsyncReadStream requirements</b></p> 41<div class="table-contents"><table class="table" summary="AsyncReadStream requirements"> 42<colgroup> 43<col> 44<col> 45<col> 46</colgroup> 47<thead><tr> 48<th> 49 <p> 50 operation 51 </p> 52 </th> 53<th> 54 <p> 55 type 56 </p> 57 </th> 58<th> 59 <p> 60 semantics, pre/post-conditions 61 </p> 62 </th> 63</tr></thead> 64<tbody> 65<tr> 66<td> 67 <p> 68 <code class="computeroutput">a.get_executor()</code> 69 </p> 70 </td> 71<td> 72 <p> 73 A type satisfying the <a class="link" href="Executor1.html" title="Executor requirements">Executor 74 requirements</a>. 75 </p> 76 </td> 77<td> 78 <p> 79 Returns the associated I/O executor. 80 </p> 81 </td> 82</tr> 83<tr> 84<td> 85 <p> 86 <code class="computeroutput">a.async_read_some(mb,t)</code> 87 </p> 88 </td> 89<td> 90 <p> 91 The return type is determined according to the requirements for 92 an <a class="link" href="asynchronous_operations.html" title="Requirements on asynchronous operations">asynchronous 93 operation</a>. 94 </p> 95 </td> 96<td> 97 <p> 98 Meets the requirements for a <a class="link" href="read_write_operations.html" title="Requirements on read and write operations">read 99 operation</a> and an <a class="link" href="asynchronous_operations.html" title="Requirements on asynchronous operations">asynchronous 100 operation</a> with completion signature <code class="computeroutput">void(error_code 101 ec, size_t n)</code>.<br> <br> If <code class="computeroutput">buffer_size(mb) > 102 0</code>, initiates an asynchronous operation to read one or more 103 bytes of data from the stream <code class="computeroutput">a</code> into the buffer sequence 104 <code class="computeroutput">mb</code>. If successful, <code class="computeroutput">ec</code> is set such that 105 <code class="computeroutput">!ec</code> is <code class="computeroutput">true</code>, and <code class="computeroutput">n</code> is the 106 number of bytes read. If an error occurred, <code class="computeroutput">ec</code> is 107 set such that <code class="computeroutput">!!ec</code> is <code class="computeroutput">true</code>, and <code class="computeroutput">n</code> 108 is 0. If all data has been read from the stream, and the stream 109 performed an orderly shutdown, <code class="computeroutput">ec</code> is <code class="computeroutput">stream_errc::eof</code> 110 and <code class="computeroutput">n</code> is 0.<br> <br> If <code class="computeroutput">buffer_size(mb) 111 == 0</code>, the operation completes immediately. <code class="computeroutput">ec</code> 112 is set such that <code class="computeroutput">!ec</code> is <code class="computeroutput">true</code>, and <code class="computeroutput">n</code> 113 is 0. 114 </p> 115 </td> 116</tr> 117</tbody> 118</table></div> 119</div> 120<br class="table-break"> 121</div> 122<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr> 123<td align="left"></td> 124<td align="right"><div class="copyright-footer">Copyright © 2003-2020 Christopher M. 125 Kohlhoff<p> 126 Distributed under the Boost Software License, Version 1.0. (See accompanying 127 file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>) 128 </p> 129</div></td> 130</tr></table> 131<hr> 132<div class="spirit-nav"> 133<a accesskey="p" href="AsyncRandomAccessWriteDevice.html"><img src="../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../reference.html"><img src="../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../boost_asio.html"><img src="../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="AsyncWriteStream.html"><img src="../../../../doc/src/images/next.png" alt="Next"></a> 134</div> 135</body> 136</html> 137