1<html> 2<head> 3<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> 4<title>Buffer-oriented asynchronous write 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="AsyncReadStream.html" title="Buffer-oriented asynchronous read stream requirements"> 10<link rel="next" href="BufferedHandshakeHandler.html" title="Buffered handshake handler 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="AsyncReadStream.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="BufferedHandshakeHandler.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.AsyncWriteStream"></a><a class="link" href="AsyncWriteStream.html" title="Buffer-oriented asynchronous write stream requirements">Buffer-oriented 28 asynchronous write stream requirements</a> 29</h3></div></div></div> 30<p> 31 A type <code class="computeroutput">X</code> meets the <code class="computeroutput">AsyncWriteStream</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">cb</code> denotes a (possibly const) value satisfying the <a class="link" href="ConstBufferSequence.html" title="Constant buffer sequence requirements"><code class="computeroutput">ConstBufferSequence</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.AsyncWriteStream.t0"></a><p class="title"><b>Table 5. AsyncWriteStream requirements</b></p> 41<div class="table-contents"><table class="table" summary="AsyncWriteStream 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_write_some(cb,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">write 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(cb) > 102 0</code>, initiates an asynchronous operation to write one or more 103 bytes of data to the stream <code class="computeroutput">a</code> from the buffer sequence 104 <code class="computeroutput">cb</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 written. If an error occurred, <code class="computeroutput">ec</code> 107 is set such that <code class="computeroutput">!!ec</code> is <code class="computeroutput">true</code>, and <code class="computeroutput">n</code> 108 is 0.<br> <br> If <code class="computeroutput">buffer_size(cb) == 0</code>, the operation 109 completes immediately. <code class="computeroutput">ec</code> is set such that <code class="computeroutput">!ec</code> 110 is <code class="computeroutput">true</code>, and <code class="computeroutput">n</code> is 0. 111 </p> 112 </td> 113</tr> 114</tbody> 115</table></div> 116</div> 117<br class="table-break"> 118</div> 119<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr> 120<td align="left"></td> 121<td align="right"><div class="copyright-footer">Copyright © 2003-2020 Christopher M. 122 Kohlhoff<p> 123 Distributed under the Boost Software License, Version 1.0. (See accompanying 124 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>) 125 </p> 126</div></td> 127</tr></table> 128<hr> 129<div class="spirit-nav"> 130<a accesskey="p" href="AsyncReadStream.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="BufferedHandshakeHandler.html"><img src="../../../../doc/src/images/next.png" alt="Next"></a> 131</div> 132</body> 133</html> 134