1<html> 2<head> 3<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> 4<title>Protocol 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="ProtoAllocator.html" title="Proto-allocator requirements"> 10<link rel="next" href="RangeConnectHandler.html" title="Range connect handler 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="ProtoAllocator.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="RangeConnectHandler.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.Protocol"></a><a class="link" href="Protocol.html" title="Protocol requirements">Protocol requirements</a> 28</h3></div></div></div> 29<p> 30 A type <code class="computeroutput">X</code> meets the <code class="computeroutput">Protocol</code> requirements if it 31 satisfies the requirements of <code class="computeroutput">Destructible</code> (C++Std [destructible]), 32 <code class="computeroutput">CopyConstructible</code> (C++Std [copyconstructible]), and <code class="computeroutput">CopyAssignable</code> 33 (C++Std [copyassignable]), as well as the additional requirements listed 34 below. 35 </p> 36<p> 37 No copy or move operation of the type <code class="computeroutput">X</code> shall exit via an exception. 38 </p> 39<div class="table"> 40<a name="boost_asio.reference.Protocol.t0"></a><p class="title"><b>Table 23. Protocol requirements</b></p> 41<div class="table-contents"><table class="table" summary="Protocol requirements"> 42<colgroup> 43<col> 44<col> 45<col> 46</colgroup> 47<thead><tr> 48<th> 49 <p> 50 expression 51 </p> 52 </th> 53<th> 54 <p> 55 return type 56 </p> 57 </th> 58<th> 59 <p> 60 assertion/note<br> pre/post-conditions 61 </p> 62 </th> 63</tr></thead> 64<tbody><tr> 65<td> 66 <p> 67 <code class="computeroutput">X::endpoint</code> 68 </p> 69 </td> 70<td> 71 <p> 72 type meeting <a class="link" href="Endpoint.html" title="Endpoint requirements">endpoint</a> 73 requirements 74 </p> 75 </td> 76<td> 77 </td> 78</tr></tbody> 79</table></div> 80</div> 81<br class="table-break"><p> 82 In the table below, <code class="computeroutput">a</code> denotes a (possibly const) value of type 83 <code class="computeroutput">X</code>. 84 </p> 85<div class="table"> 86<a name="boost_asio.reference.Protocol.t1"></a><p class="title"><b>Table 24. Protocol requirements for extensible implementations</b></p> 87<div class="table-contents"><table class="table" summary="Protocol requirements for extensible implementations"> 88<colgroup> 89<col> 90<col> 91<col> 92</colgroup> 93<thead><tr> 94<th> 95 <p> 96 expression 97 </p> 98 </th> 99<th> 100 <p> 101 return type 102 </p> 103 </th> 104<th> 105 <p> 106 assertion/note<br> pre/post-conditions 107 </p> 108 </th> 109</tr></thead> 110<tbody> 111<tr> 112<td> 113 <p> 114 <code class="computeroutput">a.family()</code> 115 </p> 116 </td> 117<td> 118 <p> 119 <code class="computeroutput">int</code> 120 </p> 121 </td> 122<td> 123 <p> 124 Returns a value suitable for passing as the <span class="emphasis"><em>domain</em></span> 125 argument to <span class="emphasis"><em>POSIX</em></span> <a href="http://www.opengroup.org/onlinepubs/9699919799/functions/socket.html" target="_top"><code class="computeroutput"><span class="identifier">socket</span><span class="special">()</span></code></a> 126 (or equivalent). 127 </p> 128 </td> 129</tr> 130<tr> 131<td> 132 <p> 133 <code class="computeroutput">a.type()</code> 134 </p> 135 </td> 136<td> 137 <p> 138 <code class="computeroutput">int</code> 139 </p> 140 </td> 141<td> 142 <p> 143 Returns a value suitable for passing as the <span class="emphasis"><em>type</em></span> 144 argument to <span class="emphasis"><em>POSIX</em></span> <a href="http://www.opengroup.org/onlinepubs/9699919799/functions/socket.html" target="_top"><code class="computeroutput"><span class="identifier">socket</span><span class="special">()</span></code></a> 145 (or equivalent). 146 </p> 147 </td> 148</tr> 149<tr> 150<td> 151 <p> 152 <code class="computeroutput">a.protocol()</code> 153 </p> 154 </td> 155<td> 156 <p> 157 <code class="computeroutput">int</code> 158 </p> 159 </td> 160<td> 161 <p> 162 Returns a value suitable for passing as the <span class="emphasis"><em>protocol</em></span> 163 argument to <span class="emphasis"><em>POSIX</em></span> <a href="http://www.opengroup.org/onlinepubs/9699919799/functions/socket.html" target="_top"><code class="computeroutput"><span class="identifier">socket</span><span class="special">()</span></code></a> 164 (or equivalent). 165 </p> 166 </td> 167</tr> 168</tbody> 169</table></div> 170</div> 171<br class="table-break"> 172</div> 173<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr> 174<td align="left"></td> 175<td align="right"><div class="copyright-footer">Copyright © 2003-2020 Christopher M. 176 Kohlhoff<p> 177 Distributed under the Boost Software License, Version 1.0. (See accompanying 178 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>) 179 </p> 180</div></td> 181</tr></table> 182<hr> 183<div class="spirit-nav"> 184<a accesskey="p" href="ProtoAllocator.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="RangeConnectHandler.html"><img src="../../../../doc/src/images/next.png" alt="Next"></a> 185</div> 186</body> 187</html> 188