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