1<html> 2<head> 3<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> 4<title>async_write</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="async_result_lt__std__packaged_task_lt__Result_lp_Args_ellipsis__rp__gt__comma__Signature__gt_/return_type.html" title="async_result< std::packaged_task< Result(Args...)>, Signature >::return_type"> 10<link rel="next" href="async_write/overload1.html" title="async_write (1 of 8 overloads)"> 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="async_result_lt__std__packaged_task_lt__Result_lp_Args_ellipsis__rp__gt__comma__Signature__gt_/return_type.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="async_write/overload1.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.async_write"></a><a class="link" href="async_write.html" title="async_write">async_write</a> 28</h3></div></div></div> 29<p> 30 <a class="indexterm" name="boost_asio.indexterm.async_write"></a> 31The <code class="computeroutput">async_write</code> function 32 is a composed asynchronous operation that writes a certain amount of data 33 to a stream before completion. 34 </p> 35<p> 36 Start an asynchronous operation to write all of the supplied data to a stream. 37 </p> 38<pre class="programlisting">template< 39 typename <a class="link" href="AsyncWriteStream.html" title="Buffer-oriented asynchronous write stream requirements">AsyncWriteStream</a>, 40 typename <a class="link" href="ConstBufferSequence.html" title="Constant buffer sequence requirements">ConstBufferSequence</a>, 41 typename <a class="link" href="WriteHandler.html" title="Write handler requirements">WriteHandler</a> = <a class="link" href="asynchronous_operations.html#boost_asio.reference.asynchronous_operations.default_completion_tokens"><span class="emphasis"><em>DEFAULT</em></span></a>> 42<a class="link" href="asynchronous_operations.html#boost_asio.reference.asynchronous_operations.automatic_deduction_of_initiating_function_return_type"><span class="emphasis"><em>DEDUCED</em></span></a> <a class="link" href="async_write/overload1.html" title="async_write (1 of 8 overloads)">async_write</a>( 43 AsyncWriteStream & s, 44 const ConstBufferSequence & buffers, 45 WriteHandler && handler = <a class="link" href="asynchronous_operations.html#boost_asio.reference.asynchronous_operations.default_completion_tokens"><span class="emphasis"><em>DEFAULT</em></span></a>, 46 typename enable_if< is_const_buffer_sequence< ConstBufferSequence >::value >::type * = 0); 47 <span class="emphasis"><em>» <a class="link" href="async_write/overload1.html" title="async_write (1 of 8 overloads)">more...</a></em></span> 48</pre> 49<p> 50 Start an asynchronous operation to write a certain amount of data to a stream. 51 </p> 52<pre class="programlisting">template< 53 typename <a class="link" href="AsyncWriteStream.html" title="Buffer-oriented asynchronous write stream requirements">AsyncWriteStream</a>, 54 typename <a class="link" href="ConstBufferSequence.html" title="Constant buffer sequence requirements">ConstBufferSequence</a>, 55 typename <a class="link" href="CompletionCondition.html" title="Completion condition requirements">CompletionCondition</a>, 56 typename <a class="link" href="WriteHandler.html" title="Write handler requirements">WriteHandler</a>> 57<a class="link" href="asynchronous_operations.html#boost_asio.reference.asynchronous_operations.automatic_deduction_of_initiating_function_return_type"><span class="emphasis"><em>DEDUCED</em></span></a> <a class="link" href="async_write/overload2.html" title="async_write (2 of 8 overloads)">async_write</a>( 58 AsyncWriteStream & s, 59 const ConstBufferSequence & buffers, 60 CompletionCondition completion_condition, 61 WriteHandler && handler, 62 typename enable_if< is_const_buffer_sequence< ConstBufferSequence >::value >::type * = 0); 63 <span class="emphasis"><em>» <a class="link" href="async_write/overload2.html" title="async_write (2 of 8 overloads)">more...</a></em></span> 64</pre> 65<p> 66 Start an asynchronous operation to write all of the supplied data to a stream. 67 </p> 68<pre class="programlisting">template< 69 typename <a class="link" href="AsyncWriteStream.html" title="Buffer-oriented asynchronous write stream requirements">AsyncWriteStream</a>, 70 typename <a class="link" href="DynamicBuffer_v1.html" title="Dynamic buffer requirements (version 1)">DynamicBuffer_v1</a>, 71 typename <a class="link" href="WriteHandler.html" title="Write handler requirements">WriteHandler</a> = <a class="link" href="asynchronous_operations.html#boost_asio.reference.asynchronous_operations.default_completion_tokens"><span class="emphasis"><em>DEFAULT</em></span></a>> 72<a class="link" href="asynchronous_operations.html#boost_asio.reference.asynchronous_operations.automatic_deduction_of_initiating_function_return_type"><span class="emphasis"><em>DEDUCED</em></span></a> <a class="link" href="async_write/overload3.html" title="async_write (3 of 8 overloads)">async_write</a>( 73 AsyncWriteStream & s, 74 DynamicBuffer_v1 && buffers, 75 WriteHandler && handler = <a class="link" href="asynchronous_operations.html#boost_asio.reference.asynchronous_operations.default_completion_tokens"><span class="emphasis"><em>DEFAULT</em></span></a>, 76 typename enable_if< is_dynamic_buffer_v1< typename decay< DynamicBuffer_v1 >::type >::value &&!is_dynamic_buffer_v2< typename decay< DynamicBuffer_v1 >::type >::value >::type * = 0); 77 <span class="emphasis"><em>» <a class="link" href="async_write/overload3.html" title="async_write (3 of 8 overloads)">more...</a></em></span> 78</pre> 79<p> 80 Start an asynchronous operation to write a certain amount of data to a stream. 81 </p> 82<pre class="programlisting">template< 83 typename <a class="link" href="AsyncWriteStream.html" title="Buffer-oriented asynchronous write stream requirements">AsyncWriteStream</a>, 84 typename <a class="link" href="DynamicBuffer_v1.html" title="Dynamic buffer requirements (version 1)">DynamicBuffer_v1</a>, 85 typename <a class="link" href="CompletionCondition.html" title="Completion condition requirements">CompletionCondition</a>, 86 typename <a class="link" href="WriteHandler.html" title="Write handler requirements">WriteHandler</a>> 87<a class="link" href="asynchronous_operations.html#boost_asio.reference.asynchronous_operations.automatic_deduction_of_initiating_function_return_type"><span class="emphasis"><em>DEDUCED</em></span></a> <a class="link" href="async_write/overload4.html" title="async_write (4 of 8 overloads)">async_write</a>( 88 AsyncWriteStream & s, 89 DynamicBuffer_v1 && buffers, 90 CompletionCondition completion_condition, 91 WriteHandler && handler, 92 typename enable_if< is_dynamic_buffer_v1< typename decay< DynamicBuffer_v1 >::type >::value &&!is_dynamic_buffer_v2< typename decay< DynamicBuffer_v1 >::type >::value >::type * = 0); 93 <span class="emphasis"><em>» <a class="link" href="async_write/overload4.html" title="async_write (4 of 8 overloads)">more...</a></em></span> 94</pre> 95<p> 96 Start an asynchronous operation to write all of the supplied data to a stream. 97 </p> 98<pre class="programlisting">template< 99 typename <a class="link" href="AsyncWriteStream.html" title="Buffer-oriented asynchronous write stream requirements">AsyncWriteStream</a>, 100 typename Allocator, 101 typename <a class="link" href="WriteHandler.html" title="Write handler requirements">WriteHandler</a> = <a class="link" href="asynchronous_operations.html#boost_asio.reference.asynchronous_operations.default_completion_tokens"><span class="emphasis"><em>DEFAULT</em></span></a>> 102<a class="link" href="asynchronous_operations.html#boost_asio.reference.asynchronous_operations.automatic_deduction_of_initiating_function_return_type"><span class="emphasis"><em>DEDUCED</em></span></a> <a class="link" href="async_write/overload5.html" title="async_write (5 of 8 overloads)">async_write</a>( 103 AsyncWriteStream & s, 104 basic_streambuf< Allocator > & b, 105 WriteHandler && handler = <a class="link" href="asynchronous_operations.html#boost_asio.reference.asynchronous_operations.default_completion_tokens"><span class="emphasis"><em>DEFAULT</em></span></a>); 106 <span class="emphasis"><em>» <a class="link" href="async_write/overload5.html" title="async_write (5 of 8 overloads)">more...</a></em></span> 107</pre> 108<p> 109 Start an asynchronous operation to write a certain amount of data to a stream. 110 </p> 111<pre class="programlisting">template< 112 typename <a class="link" href="AsyncWriteStream.html" title="Buffer-oriented asynchronous write stream requirements">AsyncWriteStream</a>, 113 typename Allocator, 114 typename <a class="link" href="CompletionCondition.html" title="Completion condition requirements">CompletionCondition</a>, 115 typename <a class="link" href="WriteHandler.html" title="Write handler requirements">WriteHandler</a>> 116<a class="link" href="asynchronous_operations.html#boost_asio.reference.asynchronous_operations.automatic_deduction_of_initiating_function_return_type"><span class="emphasis"><em>DEDUCED</em></span></a> <a class="link" href="async_write/overload6.html" title="async_write (6 of 8 overloads)">async_write</a>( 117 AsyncWriteStream & s, 118 basic_streambuf< Allocator > & b, 119 CompletionCondition completion_condition, 120 WriteHandler && handler); 121 <span class="emphasis"><em>» <a class="link" href="async_write/overload6.html" title="async_write (6 of 8 overloads)">more...</a></em></span> 122</pre> 123<p> 124 Start an asynchronous operation to write all of the supplied data to a stream. 125 </p> 126<pre class="programlisting">template< 127 typename <a class="link" href="AsyncWriteStream.html" title="Buffer-oriented asynchronous write stream requirements">AsyncWriteStream</a>, 128 typename <a class="link" href="DynamicBuffer_v2.html" title="Dynamic buffer requirements (version 2)">DynamicBuffer_v2</a>, 129 typename <a class="link" href="WriteHandler.html" title="Write handler requirements">WriteHandler</a> = <a class="link" href="asynchronous_operations.html#boost_asio.reference.asynchronous_operations.default_completion_tokens"><span class="emphasis"><em>DEFAULT</em></span></a>> 130<a class="link" href="asynchronous_operations.html#boost_asio.reference.asynchronous_operations.automatic_deduction_of_initiating_function_return_type"><span class="emphasis"><em>DEDUCED</em></span></a> <a class="link" href="async_write/overload7.html" title="async_write (7 of 8 overloads)">async_write</a>( 131 AsyncWriteStream & s, 132 DynamicBuffer_v2 buffers, 133 WriteHandler && handler = <a class="link" href="asynchronous_operations.html#boost_asio.reference.asynchronous_operations.default_completion_tokens"><span class="emphasis"><em>DEFAULT</em></span></a>, 134 typename enable_if< is_dynamic_buffer_v2< DynamicBuffer_v2 >::value >::type * = 0); 135 <span class="emphasis"><em>» <a class="link" href="async_write/overload7.html" title="async_write (7 of 8 overloads)">more...</a></em></span> 136</pre> 137<p> 138 Start an asynchronous operation to write a certain amount of data to a stream. 139 </p> 140<pre class="programlisting">template< 141 typename <a class="link" href="AsyncWriteStream.html" title="Buffer-oriented asynchronous write stream requirements">AsyncWriteStream</a>, 142 typename <a class="link" href="DynamicBuffer_v2.html" title="Dynamic buffer requirements (version 2)">DynamicBuffer_v2</a>, 143 typename <a class="link" href="CompletionCondition.html" title="Completion condition requirements">CompletionCondition</a>, 144 typename <a class="link" href="WriteHandler.html" title="Write handler requirements">WriteHandler</a>> 145<a class="link" href="asynchronous_operations.html#boost_asio.reference.asynchronous_operations.automatic_deduction_of_initiating_function_return_type"><span class="emphasis"><em>DEDUCED</em></span></a> <a class="link" href="async_write/overload8.html" title="async_write (8 of 8 overloads)">async_write</a>( 146 AsyncWriteStream & s, 147 DynamicBuffer_v2 buffers, 148 CompletionCondition completion_condition, 149 WriteHandler && handler, 150 typename enable_if< is_dynamic_buffer_v2< DynamicBuffer_v2 >::value >::type * = 0); 151 <span class="emphasis"><em>» <a class="link" href="async_write/overload8.html" title="async_write (8 of 8 overloads)">more...</a></em></span> 152</pre> 153<h5> 154<a name="boost_asio.reference.async_write.h0"></a> 155 <span class="phrase"><a name="boost_asio.reference.async_write.requirements"></a></span><a class="link" href="async_write.html#boost_asio.reference.async_write.requirements">Requirements</a> 156 </h5> 157<p> 158 <span class="emphasis"><em>Header: </em></span><code class="literal">boost/asio/write.hpp</code> 159 </p> 160<p> 161 <span class="emphasis"><em>Convenience header: </em></span><code class="literal">boost/asio.hpp</code> 162 </p> 163</div> 164<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr> 165<td align="left"></td> 166<td align="right"><div class="copyright-footer">Copyright © 2003-2020 Christopher M. 167 Kohlhoff<p> 168 Distributed under the Boost Software License, Version 1.0. (See accompanying 169 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>) 170 </p> 171</div></td> 172</tr></table> 173<hr> 174<div class="spirit-nav"> 175<a accesskey="p" href="async_result_lt__std__packaged_task_lt__Result_lp_Args_ellipsis__rp__gt__comma__Signature__gt_/return_type.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="async_write/overload1.html"><img src="../../../../doc/src/images/next.png" alt="Next"></a> 176</div> 177</body> 178</html> 179