1[/
2 / Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
3 /
4 / Distributed under the Boost Software License, Version 1.0. (See accompanying
5 / file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
6 /]
7
8[section:GettableSocketOption Gettable socket option requirements]
9
10A type `X` meets the `GettableSocketOption` requirements if it satisfies the
11requirements listed below.
12
13In the table below, `a` denotes a (possibly const) value of type `X`, `b`
14denotes a value of type `X`, `p` denotes a (possibly const) value that meets
15the [link boost_asio.reference.Protocol `Protocol`] requirements, and `s` denotes a
16(possibly const) value of a type that is convertible to `size_t` and denotes a
17size in bytes.
18
19[table GettableSocketOption requirements for extensible implementations
20  [[expression] [type] [assertion/note[br]pre/post-conditions]]
21  [
22    [`a.level(p)`]
23    [`int`]
24    [
25      Returns a value suitable for passing as the /level/ argument to __POSIX__
26      __getsockopt__ (or equivalent).
27    ]
28  ]
29  [
30    [`a.name(p)`]
31    [`int`]
32    [
33      Returns a value suitable for passing as the /option_name/ argument to
34      __POSIX__ __getsockopt__ (or equivalent).
35    ]
36  ]
37  [
38    [`b.data(p)`]
39    [`void*`]
40    [
41      Returns a pointer suitable for passing as the /option_value/ argument to
42      __POSIX__ __getsockopt__ (or equivalent).
43    ]
44  ]
45  [
46    [`a.size(p)`]
47    [`size_t`]
48    [
49      Returns a value suitable for passing as the /option_len/ argument to
50      __POSIX__ __getsockopt__ (or equivalent), after appropriate
51      integer conversion has been performed.
52    ]
53  ]
54  [
55    [`b.resize(p,s)`]
56    []
57    [
58      post: `b.size(p) == s`.[br]
59      Passed the value contained in the /option_len/ argument to __POSIX__
60      __getsockopt__ (or equivalent) after successful completion of the
61      function. Permitted to throw an exception if the socket option object `b`
62      does not support the specified size.
63    ]
64  ]
65]
66
67[endsect]
68