1<html> 2<head> 3<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> 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 A type <code class="computeroutput">X</code> meets the <code class="computeroutput">SyncWriteStream</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">ec</code> denotes an object of type <code class="computeroutput">error_code</code>. 38 </p> 39<div class="table"> 40<a name="boost_asio.reference.SyncWriteStream.t0"></a><p class="title"><b>Table 31. SyncWriteStream requirements</b></p> 41<div class="table-contents"><table class="table" summary="SyncWriteStream 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><tr> 65<td> 66 <p> 67 <code class="computeroutput">a.write_some(cb)</code><br> <code class="computeroutput">a.write_some(cb,ec)</code> 68 </p> 69 </td> 70<td> 71 <p> 72 <code class="computeroutput">size_t</code> 73 </p> 74 </td> 75<td> 76 <p> 77 Meets the requirements for a <a class="link" href="read_write_operations.html" title="Requirements on read and write operations">write 78 operation</a>.<br> <br> If <code class="computeroutput">buffer_size(cb) > 0</code>, 79 writes one or more bytes of data to the stream <code class="computeroutput">a</code> from 80 the buffer sequence <code class="computeroutput">cb</code>. If successful, sets <code class="computeroutput">ec</code> 81 such that <code class="computeroutput">!ec</code> is <code class="computeroutput">true</code>, and returns the 82 number of bytes written. If an error occurred, sets <code class="computeroutput">ec</code> 83 such that <code class="computeroutput">!!ec</code> is <code class="computeroutput">true</code>, and returns 0.<br> 84 <br> If <code class="computeroutput">buffer_size(cb) == 0</code>, the operation shall 85 not block. Sets <code class="computeroutput">ec</code> such that <code class="computeroutput">!ec</code> is 86 <code class="computeroutput">true</code>, and returns 0. 87 </p> 88 </td> 89</tr></tbody> 90</table></div> 91</div> 92<br class="table-break"> 93</div> 94<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr> 95<td align="left"></td> 96<td align="right"><div class="copyright-footer">Copyright © 2003-2020 Christopher M. 97 Kohlhoff<p> 98 Distributed under the Boost Software License, Version 1.0. (See accompanying 99 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>) 100 </p> 101</div></td> 102</tr></table> 103<hr> 104<div class="spirit-nav"> 105<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> 106</div> 107</body> 108</html> 109