1<html> 2<head> 3<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> 4<title>websocket::stream::write (1 of 2 overloads)</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="../../../../index.html" title="Chapter 1. Boost.Beast"> 8<link rel="up" href="../write.html" title="websocket::stream::write"> 9<link rel="prev" href="../write.html" title="websocket::stream::write"> 10<link rel="next" href="overload2.html" title="websocket::stream::write (2 of 2 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="../write.html"><img src="../../../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../write.html"><img src="../../../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../../../index.html"><img src="../../../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="overload2.html"><img src="../../../../../../../../doc/src/images/next.png" alt="Next"></a> 24</div> 25<div class="section"> 26<div class="titlepage"><div><div><h6 class="title"> 27<a name="beast.ref.boost__beast__websocket__stream.write.overload1"></a><a class="link" href="overload1.html" title="websocket::stream::write (1 of 2 overloads)">websocket::stream::write 28 (1 of 2 overloads)</a> 29</h6></div></div></div> 30<p> 31 Write a complete message. 32 </p> 33<h7><a name="beast.ref.boost__beast__websocket__stream.write.overload1.h0"></a> 34 <span class="phrase"><a name="beast.ref.boost__beast__websocket__stream.write.overload1.synopsis"></a></span><a class="link" href="overload1.html#beast.ref.boost__beast__websocket__stream.write.overload1.synopsis">Synopsis</a> 35 </h7><pre class="programlisting"><span class="keyword">template</span><span class="special"><</span> 36 <span class="keyword">class</span> <a href="../../../../../../../../doc/html/boost_asio/reference/ConstBufferSequence.html" target="_top"><span class="emphasis"><em>ConstBufferSequence</em></span></a><span class="special">></span> 37<span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span> 38<span class="identifier">write</span><span class="special">(</span> 39 <span class="identifier">ConstBufferSequence</span> <span class="keyword">const</span><span class="special">&</span> <span class="identifier">buffers</span><span class="special">);</span> 40</pre> 41<h7><a name="beast.ref.boost__beast__websocket__stream.write.overload1.h1"></a> 42 <span class="phrase"><a name="beast.ref.boost__beast__websocket__stream.write.overload1.description"></a></span><a class="link" href="overload1.html#beast.ref.boost__beast__websocket__stream.write.overload1.description">Description</a> 43 </h7><p> 44 This function is used to write a complete message. The call blocks until 45 one of the following is true: 46 </p> 47<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "> 48<li class="listitem"> 49 The message is written. 50 </li> 51<li class="listitem"> 52 An error occurs. 53 </li> 54</ul></div> 55<p> 56 The algorithm, known as a <span class="emphasis"><em>composed operation</em></span>, is 57 implemented in terms of calls to the next layer's <code class="computeroutput"><span class="identifier">write_some</span></code> 58 function. The current setting of the <a class="link" href="../binary/overload1.html" title="websocket::stream::binary (1 of 2 overloads)"><code class="computeroutput"><span class="identifier">binary</span></code></a> option controls whether 59 the message opcode is set to text or binary. If the <a class="link" href="../auto_fragment/overload1.html" title="websocket::stream::auto_fragment (1 of 2 overloads)"><code class="computeroutput"><span class="identifier">auto_fragment</span></code></a> option is set, 60 the message will be split into one or more frames as necessary. The actual 61 payload contents sent may be transformed as per the WebSocket protocol 62 settings. 63 </p> 64<h7><a name="beast.ref.boost__beast__websocket__stream.write.overload1.h2"></a> 65 <span class="phrase"><a name="beast.ref.boost__beast__websocket__stream.write.overload1.parameters"></a></span><a class="link" href="overload1.html#beast.ref.boost__beast__websocket__stream.write.overload1.parameters">Parameters</a> 66 </h7><div class="informaltable"><table class="table"> 67<colgroup> 68<col> 69<col> 70</colgroup> 71<thead><tr> 72<th> 73 <p> 74 Name 75 </p> 76 </th> 77<th> 78 <p> 79 Description 80 </p> 81 </th> 82</tr></thead> 83<tbody><tr> 84<td> 85 <p> 86 <code class="computeroutput"><span class="identifier">buffers</span></code> 87 </p> 88 </td> 89<td> 90 <p> 91 The buffers containing the message to send. 92 </p> 93 </td> 94</tr></tbody> 95</table></div> 96<h7><a name="beast.ref.boost__beast__websocket__stream.write.overload1.h3"></a> 97 <span class="phrase"><a name="beast.ref.boost__beast__websocket__stream.write.overload1.return_value"></a></span><a class="link" href="overload1.html#beast.ref.boost__beast__websocket__stream.write.overload1.return_value">Return 98 Value</a> 99 </h7><p> 100 The number of bytes sent from the buffers. 101 </p> 102<h7><a name="beast.ref.boost__beast__websocket__stream.write.overload1.h4"></a> 103 <span class="phrase"><a name="beast.ref.boost__beast__websocket__stream.write.overload1.exceptions"></a></span><a class="link" href="overload1.html#beast.ref.boost__beast__websocket__stream.write.overload1.exceptions">Exceptions</a> 104 </h7><div class="informaltable"><table class="table"> 105<colgroup> 106<col> 107<col> 108</colgroup> 109<thead><tr> 110<th> 111 <p> 112 Type 113 </p> 114 </th> 115<th> 116 <p> 117 Thrown On 118 </p> 119 </th> 120</tr></thead> 121<tbody><tr> 122<td> 123 <p> 124 <code class="computeroutput"><span class="identifier">system_error</span></code> 125 </p> 126 </td> 127<td> 128 <p> 129 Thrown on failure. 130 </p> 131 </td> 132</tr></tbody> 133</table></div> 134</div> 135<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr> 136<td align="left"></td> 137<td align="right"><div class="copyright-footer">Copyright © 2016-2019 Vinnie 138 Falco<p> 139 Distributed under the Boost Software License, Version 1.0. (See accompanying 140 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>) 141 </p> 142</div></td> 143</tr></table> 144<hr> 145<div class="spirit-nav"> 146<a accesskey="p" href="../write.html"><img src="../../../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../write.html"><img src="../../../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../../../index.html"><img src="../../../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="overload2.html"><img src="../../../../../../../../doc/src/images/next.png" alt="Next"></a> 147</div> 148</body> 149</html> 150