GettableSocketOption.qbk 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. [/
  2. / Copyright (c) 2003-2019 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. [section:GettableSocketOption Gettable socket option requirements]
  8. A type `X` meets the `GettableSocketOption` requirements if it satisfies the
  9. requirements listed below.
  10. In the table below, `a` denotes a (possibly const) value of type `X`, `b`
  11. denotes a value of type `X`, `p` denotes a (possibly const) value that meets
  12. the [link boost_asio.reference.Protocol `Protocol`] requirements, and `s` denotes a
  13. (possibly const) value of a type that is convertible to `size_t` and denotes a
  14. size in bytes.
  15. [table GettableSocketOption requirements for extensible implementations
  16. [[expression] [type] [assertion/note\npre/post-conditions]]
  17. [
  18. [`a.level(p)`]
  19. [`int`]
  20. [
  21. Returns a value suitable for passing as the /level/ argument to __POSIX__
  22. __getsockopt__ (or equivalent).
  23. ]
  24. ]
  25. [
  26. [`a.name(p)`]
  27. [`int`]
  28. [
  29. Returns a value suitable for passing as the /option_name/ argument to
  30. __POSIX__ __getsockopt__ (or equivalent).
  31. ]
  32. ]
  33. [
  34. [`b.data(p)`]
  35. [`void*`]
  36. [
  37. Returns a pointer suitable for passing as the /option_value/ argument to
  38. __POSIX__ __getsockopt__ (or equivalent).
  39. ]
  40. ]
  41. [
  42. [`a.size(p)`]
  43. [`size_t`]
  44. [
  45. Returns a value suitable for passing as the /option_len/ argument to
  46. __POSIX__ __getsockopt__ (or equivalent), after appropriate
  47. integer conversion has been performed.
  48. ]
  49. ]
  50. [
  51. [`b.resize(p,s)`]
  52. []
  53. [
  54. post: `b.size(p) == s`.\n
  55. Passed the value contained in the /option_len/ argument to __POSIX__
  56. __getsockopt__ (or equivalent) after successful completion of the
  57. function. Permitted to throw an exception if the socket option object `b`
  58. does not support the specified size.
  59. ]
  60. ]
  61. ]
  62. [endsect]