1<html> 2<head> 3<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> 4<title>Gettable socket option 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="GettableSerialPortOption.html" title="Gettable serial port option requirements"> 10<link rel="next" href="Handler.html" title="Handlers"> 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="GettableSerialPortOption.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="Handler.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.GettableSocketOption"></a><a class="link" href="GettableSocketOption.html" title="Gettable socket option requirements">Gettable socket 28 option requirements</a> 29</h3></div></div></div> 30<p> 31 A type <code class="computeroutput">X</code> meets the <code class="computeroutput">GettableSocketOption</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 (possibly const) value of type 36 <code class="computeroutput">X</code>, <code class="computeroutput">b</code> denotes a value of type <code class="computeroutput">X</code>, <code class="computeroutput">p</code> 37 denotes a (possibly const) value that meets the <a class="link" href="Protocol.html" title="Protocol requirements"><code class="computeroutput">Protocol</code></a> 38 requirements, and <code class="computeroutput">s</code> denotes a (possibly const) value of a type 39 that is convertible to <code class="computeroutput">size_t</code> and denotes a size in bytes. 40 </p> 41<div class="table"> 42<a name="boost_asio.reference.GettableSocketOption.t0"></a><p class="title"><b>Table 17. GettableSocketOption requirements for extensible implementations</b></p> 43<div class="table-contents"><table class="table" summary="GettableSocketOption requirements for extensible implementations"> 44<colgroup> 45<col> 46<col> 47<col> 48</colgroup> 49<thead><tr> 50<th> 51 <p> 52 expression 53 </p> 54 </th> 55<th> 56 <p> 57 type 58 </p> 59 </th> 60<th> 61 <p> 62 assertion/note<br> pre/post-conditions 63 </p> 64 </th> 65</tr></thead> 66<tbody> 67<tr> 68<td> 69 <p> 70 <code class="computeroutput">a.level(p)</code> 71 </p> 72 </td> 73<td> 74 <p> 75 <code class="computeroutput">int</code> 76 </p> 77 </td> 78<td> 79 <p> 80 Returns a value suitable for passing as the <span class="emphasis"><em>level</em></span> 81 argument to <span class="emphasis"><em>POSIX</em></span> <a href="http://www.opengroup.org/onlinepubs/9699919799/functions/getsockopt.html" target="_top"><code class="computeroutput"><span class="identifier">getsockopt</span><span class="special">()</span></code></a> 82 (or equivalent). 83 </p> 84 </td> 85</tr> 86<tr> 87<td> 88 <p> 89 <code class="computeroutput">a.name(p)</code> 90 </p> 91 </td> 92<td> 93 <p> 94 <code class="computeroutput">int</code> 95 </p> 96 </td> 97<td> 98 <p> 99 Returns a value suitable for passing as the <span class="emphasis"><em>option_name</em></span> 100 argument to <span class="emphasis"><em>POSIX</em></span> <a href="http://www.opengroup.org/onlinepubs/9699919799/functions/getsockopt.html" target="_top"><code class="computeroutput"><span class="identifier">getsockopt</span><span class="special">()</span></code></a> 101 (or equivalent). 102 </p> 103 </td> 104</tr> 105<tr> 106<td> 107 <p> 108 <code class="computeroutput">b.data(p)</code> 109 </p> 110 </td> 111<td> 112 <p> 113 <code class="computeroutput">void*</code> 114 </p> 115 </td> 116<td> 117 <p> 118 Returns a pointer suitable for passing as the <span class="emphasis"><em>option_value</em></span> 119 argument to <span class="emphasis"><em>POSIX</em></span> <a href="http://www.opengroup.org/onlinepubs/9699919799/functions/getsockopt.html" target="_top"><code class="computeroutput"><span class="identifier">getsockopt</span><span class="special">()</span></code></a> 120 (or equivalent). 121 </p> 122 </td> 123</tr> 124<tr> 125<td> 126 <p> 127 <code class="computeroutput">a.size(p)</code> 128 </p> 129 </td> 130<td> 131 <p> 132 <code class="computeroutput">size_t</code> 133 </p> 134 </td> 135<td> 136 <p> 137 Returns a value suitable for passing as the <span class="emphasis"><em>option_len</em></span> 138 argument to <span class="emphasis"><em>POSIX</em></span> <a href="http://www.opengroup.org/onlinepubs/9699919799/functions/getsockopt.html" target="_top"><code class="computeroutput"><span class="identifier">getsockopt</span><span class="special">()</span></code></a> 139 (or equivalent), after appropriate integer conversion has been 140 performed. 141 </p> 142 </td> 143</tr> 144<tr> 145<td> 146 <p> 147 <code class="computeroutput">b.resize(p,s)</code> 148 </p> 149 </td> 150<td> 151 </td> 152<td> 153 <p> 154 post: <code class="computeroutput">b.size(p) == s</code>.<br> Passed the value contained 155 in the <span class="emphasis"><em>option_len</em></span> argument to <span class="emphasis"><em>POSIX</em></span> 156 <a href="http://www.opengroup.org/onlinepubs/9699919799/functions/getsockopt.html" target="_top"><code class="computeroutput"><span class="identifier">getsockopt</span><span class="special">()</span></code></a> 157 (or equivalent) after successful completion of the function. Permitted 158 to throw an exception if the socket option object <code class="computeroutput">b</code> 159 does not support the specified size. 160 </p> 161 </td> 162</tr> 163</tbody> 164</table></div> 165</div> 166<br class="table-break"> 167</div> 168<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr> 169<td align="left"></td> 170<td align="right"><div class="copyright-footer">Copyright © 2003-2020 Christopher M. 171 Kohlhoff<p> 172 Distributed under the Boost Software License, Version 1.0. (See accompanying 173 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>) 174 </p> 175</div></td> 176</tr></table> 177<hr> 178<div class="spirit-nav"> 179<a accesskey="p" href="GettableSerialPortOption.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="Handler.html"><img src="../../../../doc/src/images/next.png" alt="Next"></a> 180</div> 181</body> 182</html> 183