1<html> 2<head> 3<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> 4<title>Endpoint 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="DynamicBuffer_v2.html" title="Dynamic buffer requirements (version 2)"> 10<link rel="next" href="EndpointSequence.html" title="Endpoint sequence 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="DynamicBuffer_v2.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="EndpointSequence.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.Endpoint"></a><a class="link" href="Endpoint.html" title="Endpoint requirements">Endpoint requirements</a> 28</h3></div></div></div> 29<p> 30 A type <code class="computeroutput">X</code> meets the <code class="computeroutput">Endpoint</code> requirements if it 31 satisfies the requirements of <code class="computeroutput">Destructible</code> (C++Std [destructible]), 32 <code class="computeroutput">DefaultConstructible</code> (C++Std [defaultconstructible]), <code class="computeroutput">CopyConstructible</code> 33 (C++Std [copyconstructible]), and <code class="computeroutput">CopyAssignable</code> (C++Std [copyassignable]), 34 as well as the additional requirements listed below. 35 </p> 36<p> 37 The default constructor and move operations of the type <code class="computeroutput">X</code> shall 38 not exit via an exception. 39 </p> 40<p> 41 In the table below, <code class="computeroutput">a</code> denotes a (possibly const) value of type 42 <code class="computeroutput">X</code>, and <code class="computeroutput">u</code> denotes an identifier. 43 </p> 44<div class="table"> 45<a name="boost_asio.reference.Endpoint.t0"></a><p class="title"><b>Table 11. Endpoint requirements</b></p> 46<div class="table-contents"><table class="table" summary="Endpoint requirements"> 47<colgroup> 48<col> 49<col> 50<col> 51</colgroup> 52<thead><tr> 53<th> 54 <p> 55 expression 56 </p> 57 </th> 58<th> 59 <p> 60 type 61 </p> 62 </th> 63<th> 64 <p> 65 assertion/note<br> pre/post-conditions 66 </p> 67 </th> 68</tr></thead> 69<tbody> 70<tr> 71<td> 72 <p> 73 <code class="computeroutput">X::protocol_type</code> 74 </p> 75 </td> 76<td> 77 <p> 78 type meeting <a class="link" href="Protocol.html" title="Protocol requirements"><code class="computeroutput">Protocol</code></a> 79 requirements 80 </p> 81 </td> 82<td> 83 </td> 84</tr> 85<tr> 86<td> 87 <p> 88 <code class="computeroutput">a.protocol()</code> 89 </p> 90 </td> 91<td> 92 <p> 93 <code class="computeroutput">protocol_type</code> 94 </p> 95 </td> 96<td> 97 </td> 98</tr> 99</tbody> 100</table></div> 101</div> 102<br class="table-break"><p> 103 In the table below, <code class="computeroutput">a</code> denotes a (possibly const) value of type 104 <code class="computeroutput">X</code>, <code class="computeroutput">b</code> denotes a value of type <code class="computeroutput">X</code>, and 105 <code class="computeroutput">s</code> denotes a (possibly const) value of a type that is convertible 106 to <code class="computeroutput">size_t</code> and denotes a size in bytes. 107 </p> 108<div class="table"> 109<a name="boost_asio.reference.Endpoint.t1"></a><p class="title"><b>Table 12. Endpoint requirements for extensible implementations</b></p> 110<div class="table-contents"><table class="table" summary="Endpoint requirements for extensible implementations"> 111<colgroup> 112<col> 113<col> 114<col> 115</colgroup> 116<thead><tr> 117<th> 118 <p> 119 expression 120 </p> 121 </th> 122<th> 123 <p> 124 type 125 </p> 126 </th> 127<th> 128 <p> 129 assertion/note<br> pre/post-conditions 130 </p> 131 </th> 132</tr></thead> 133<tbody> 134<tr> 135<td> 136 <p> 137 <code class="computeroutput">a.data()</code> 138 </p> 139 </td> 140<td> 141 <p> 142 <code class="computeroutput">const void*</code> 143 </p> 144 </td> 145<td> 146 <p> 147 Returns a pointer suitable for passing as the <span class="emphasis"><em>address</em></span> 148 argument to functions such as <span class="emphasis"><em>POSIX</em></span> <a href="http://www.opengroup.org/onlinepubs/9699919799/functions/connect.html" target="_top"><code class="computeroutput"><span class="identifier">connect</span><span class="special">()</span></code></a>, 149 or as the <span class="emphasis"><em>dest_addr</em></span> argument to functions 150 such as <span class="emphasis"><em>POSIX</em></span> <a href="http://www.opengroup.org/onlinepubs/9699919799/functions/sendto.html" target="_top"><code class="computeroutput"><span class="identifier">sendto</span><span class="special">()</span></code></a>. 151 The implementation shall perform a <code class="computeroutput">static_cast</code> on 152 the pointer to convert it to <code class="computeroutput">const sockaddr*</code>. 153 </p> 154 </td> 155</tr> 156<tr> 157<td> 158 <p> 159 <code class="computeroutput">b.data()</code> 160 </p> 161 </td> 162<td> 163 <p> 164 <code class="computeroutput">void*</code> 165 </p> 166 </td> 167<td> 168 <p> 169 Returns a pointer suitable for passing as the <span class="emphasis"><em>address</em></span> 170 argument to functions such as <span class="emphasis"><em>POSIX</em></span> <a href="http://www.opengroup.org/onlinepubs/9699919799/functions/accept.html" target="_top"><code class="computeroutput"><span class="identifier">accept</span><span class="special">()</span></code></a>, 171 <a href="http://www.opengroup.org/onlinepubs/9699919799/functions/getpeername.html" target="_top"><code class="computeroutput"><span class="identifier">getpeername</span><span class="special">()</span></code></a>, 172 <a href="http://www.opengroup.org/onlinepubs/9699919799/functions/getsockname.html" target="_top"><code class="computeroutput"><span class="identifier">getsockname</span><span class="special">()</span></code></a> 173 and <a href="http://www.opengroup.org/onlinepubs/9699919799/functions/recvfrom.html" target="_top"><code class="computeroutput"><span class="identifier">recvfrom</span><span class="special">()</span></code></a>. 174 The implementation shall perform a <code class="computeroutput">static_cast</code> on 175 the pointer to convert it to <code class="computeroutput">sockaddr*</code>. 176 </p> 177 </td> 178</tr> 179<tr> 180<td> 181 <p> 182 <code class="computeroutput">a.size()</code> 183 </p> 184 </td> 185<td> 186 <p> 187 <code class="computeroutput">size_t</code> 188 </p> 189 </td> 190<td> 191 <p> 192 Returns a value suitable for passing as the <span class="emphasis"><em>address_len</em></span> 193 argument to functions such as <span class="emphasis"><em>POSIX</em></span> <a href="http://www.opengroup.org/onlinepubs/9699919799/functions/connect.html" target="_top"><code class="computeroutput"><span class="identifier">connect</span><span class="special">()</span></code></a>, 194 or as the <span class="emphasis"><em>dest_len</em></span> argument to functions such 195 as <span class="emphasis"><em>POSIX</em></span> <a href="http://www.opengroup.org/onlinepubs/9699919799/functions/sendto.html" target="_top"><code class="computeroutput"><span class="identifier">sendto</span><span class="special">()</span></code></a>, 196 after appropriate integer conversion has been performed. 197 </p> 198 </td> 199</tr> 200<tr> 201<td> 202 <p> 203 <code class="computeroutput">b.resize(s)</code> 204 </p> 205 </td> 206<td> 207 </td> 208<td> 209 <p> 210 pre: <code class="computeroutput">s >= 0</code><br> post: <code class="computeroutput">a.size() == s</code><br> 211 Passed the value contained in the <span class="emphasis"><em>address_len</em></span> 212 argument to functions such as <span class="emphasis"><em>POSIX</em></span> <a href="http://www.opengroup.org/onlinepubs/9699919799/functions/accept.html" target="_top"><code class="computeroutput"><span class="identifier">accept</span><span class="special">()</span></code></a>, 213 <a href="http://www.opengroup.org/onlinepubs/9699919799/functions/getpeername.html" target="_top"><code class="computeroutput"><span class="identifier">getpeername</span><span class="special">()</span></code></a>, 214 <a href="http://www.opengroup.org/onlinepubs/9699919799/functions/getsockname.html" target="_top"><code class="computeroutput"><span class="identifier">getsockname</span><span class="special">()</span></code></a> 215 and <a href="http://www.opengroup.org/onlinepubs/9699919799/functions/recvfrom.html" target="_top"><code class="computeroutput"><span class="identifier">recvfrom</span><span class="special">()</span></code></a>, 216 after successful completion of the function. Permitted to throw 217 an exception if the protocol associated with the endpoint object 218 <code class="computeroutput">a</code> does not support the specified size. 219 </p> 220 </td> 221</tr> 222<tr> 223<td> 224 <p> 225 <code class="computeroutput">a.capacity()</code> 226 </p> 227 </td> 228<td> 229 <p> 230 <code class="computeroutput">size_t</code> 231 </p> 232 </td> 233<td> 234 <p> 235 Returns a value suitable for passing as the <span class="emphasis"><em>address_len</em></span> 236 argument to functions such as <span class="emphasis"><em>POSIX</em></span> <a href="http://www.opengroup.org/onlinepubs/9699919799/functions/accept.html" target="_top"><code class="computeroutput"><span class="identifier">accept</span><span class="special">()</span></code></a>, 237 <a href="http://www.opengroup.org/onlinepubs/9699919799/functions/getpeername.html" target="_top"><code class="computeroutput"><span class="identifier">getpeername</span><span class="special">()</span></code></a>, 238 <a href="http://www.opengroup.org/onlinepubs/9699919799/functions/getsockname.html" target="_top"><code class="computeroutput"><span class="identifier">getsockname</span><span class="special">()</span></code></a> 239 and <a href="http://www.opengroup.org/onlinepubs/9699919799/functions/recvfrom.html" target="_top"><code class="computeroutput"><span class="identifier">recvfrom</span><span class="special">()</span></code></a>, 240 after appropriate integer conversion has been performed. 241 </p> 242 </td> 243</tr> 244</tbody> 245</table></div> 246</div> 247<br class="table-break"> 248</div> 249<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr> 250<td align="left"></td> 251<td align="right"><div class="copyright-footer">Copyright © 2003-2020 Christopher M. 252 Kohlhoff<p> 253 Distributed under the Boost Software License, Version 1.0. (See accompanying 254 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>) 255 </p> 256</div></td> 257</tr></table> 258<hr> 259<div class="spirit-nav"> 260<a accesskey="p" href="DynamicBuffer_v2.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="EndpointSequence.html"><img src="../../../../doc/src/images/next.png" alt="Next"></a> 261</div> 262</body> 263</html> 264