Imported Upstream version 1.64.0
[platform/upstream/boost.git] / doc / html / boost_asio / reference / SyncWriteStream.html
1 <html>
2 <head>
3 <meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
4 <title>Buffer-oriented synchronous 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="SyncReadStream.html" title="Buffer-oriented synchronous read stream requirements">
10 <link rel="next" href="TimeTraits.html" title="Time traits 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="SyncReadStream.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="TimeTraits.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.SyncWriteStream"></a><a class="link" href="SyncWriteStream.html" title="Buffer-oriented synchronous write stream requirements">Buffer-oriented
28       synchronous write stream requirements</a>
29 </h3></div></div></div>
30 <p>
31         In the table below, <code class="computeroutput"><span class="identifier">a</span></code> denotes
32         a synchronous write stream object, <code class="computeroutput"><span class="identifier">cb</span></code>
33         denotes an object satisfying <a class="link" href="ConstBufferSequence.html" title="Constant buffer sequence requirements">constant
34         buffer sequence</a> requirements, and <code class="computeroutput"><span class="identifier">ec</span></code>
35         denotes an object of type <code class="computeroutput"><span class="identifier">error_code</span></code>.
36       </p>
37 <div class="table">
38 <a name="boost_asio.reference.SyncWriteStream.t0"></a><p class="title"><b>Table&#160;37.&#160;Buffer-oriented synchronous write stream requirements</b></p>
39 <div class="table-contents"><table class="table" summary="Buffer-oriented synchronous write stream requirements">
40 <colgroup>
41 <col>
42 <col>
43 <col>
44 </colgroup>
45 <thead><tr>
46 <th>
47                 <p>
48                   operation
49                 </p>
50               </th>
51 <th>
52                 <p>
53                   type
54                 </p>
55               </th>
56 <th>
57                 <p>
58                   semantics, pre/post-conditions
59                 </p>
60               </th>
61 </tr></thead>
62 <tbody>
63 <tr>
64 <td>
65                 <p>
66                   <code class="computeroutput"><span class="identifier">a</span><span class="special">.</span><span class="identifier">write_some</span><span class="special">(</span><span class="identifier">cb</span><span class="special">);</span></code>
67                 </p>
68               </td>
69 <td>
70                 <p>
71                   <code class="computeroutput"><span class="identifier">size_t</span></code>
72                 </p>
73               </td>
74 <td>
75                 <p>
76                   Equivalent to:
77 </p>
78 <pre class="programlisting"><span class="identifier">error_code</span> <span class="identifier">ec</span><span class="special">;</span>
79 <span class="identifier">size_t</span> <span class="identifier">s</span> <span class="special">=</span> <span class="identifier">a</span><span class="special">.</span><span class="identifier">write_some</span><span class="special">(</span><span class="identifier">cb</span><span class="special">,</span> <span class="identifier">ec</span><span class="special">);</span>
80 <span class="keyword">if</span> <span class="special">(</span><span class="identifier">ec</span><span class="special">)</span> <span class="keyword">throw</span> <span class="identifier">system_error</span><span class="special">(</span><span class="identifier">ec</span><span class="special">);</span>
81 <span class="keyword">return</span> <span class="identifier">s</span><span class="special">;</span>
82 </pre>
83 <p>
84                 </p>
85               </td>
86 </tr>
87 <tr>
88 <td>
89                 <p>
90                   <code class="computeroutput"><span class="identifier">a</span><span class="special">.</span><span class="identifier">write_some</span><span class="special">(</span><span class="identifier">cb</span><span class="special">,</span>
91                   <span class="identifier">ec</span><span class="special">);</span></code>
92                 </p>
93               </td>
94 <td>
95                 <p>
96                   <code class="computeroutput"><span class="identifier">size_t</span></code>
97                 </p>
98               </td>
99 <td>
100                 <p>
101                   Writes one or more bytes of data to the stream <code class="computeroutput"><span class="identifier">a</span></code>.<br>
102                   <br> The constant buffer sequence <code class="computeroutput"><span class="identifier">cb</span></code>
103                   specifies memory where the data to be written is located. The
104                   <code class="computeroutput"><span class="identifier">write_some</span></code> operation
105                   shall always write a buffer in the sequence completely before proceeding
106                   to the next.<br> <br> If successful, returns the number of
107                   bytes written and sets <code class="computeroutput"><span class="identifier">ec</span></code>
108                   such that <code class="computeroutput"><span class="special">!</span><span class="identifier">ec</span></code>
109                   is true. If an error occurred, returns <code class="computeroutput"><span class="number">0</span></code>
110                   and sets <code class="computeroutput"><span class="identifier">ec</span></code> such
111                   that <code class="computeroutput"><span class="special">!!</span><span class="identifier">ec</span></code>
112                   is true.<br> <br> If the total size of all buffers in the sequence
113                   <code class="computeroutput"><span class="identifier">cb</span></code> is <code class="computeroutput"><span class="number">0</span></code>, the function shall return <code class="computeroutput"><span class="number">0</span></code> immediately.
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 &#169; 2003-2017 Christopher M. Kohlhoff<p>
125         Distributed under the Boost Software License, Version 1.0. (See accompanying
126         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>)
127       </p>
128 </div></td>
129 </tr></table>
130 <hr>
131 <div class="spirit-nav">
132 <a accesskey="p" href="SyncReadStream.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="TimeTraits.html"><img src="../../../../doc/src/images/next.png" alt="Next"></a>
133 </div>
134 </body>
135 </html>