Audio plugin host https://kx.studio/carla
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

v6_only.hpp 1.6KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. //
  2. // ip/v6_only.hpp
  3. // ~~~~~~~~~~~~~~
  4. //
  5. // Copyright (c) 2003-2019 Christopher M. Kohlhoff (chris at kohlhoff dot com)
  6. //
  7. // Distributed under the Boost Software License, Version 1.0. (See accompanying
  8. // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
  9. //
  10. #ifndef ASIO_IP_V6_ONLY_HPP
  11. #define ASIO_IP_V6_ONLY_HPP
  12. #if defined(_MSC_VER) && (_MSC_VER >= 1200)
  13. # pragma once
  14. #endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
  15. #include "asio/detail/config.hpp"
  16. #include "asio/detail/socket_option.hpp"
  17. #include "asio/detail/push_options.hpp"
  18. namespace asio {
  19. namespace ip {
  20. /// Socket option for determining whether an IPv6 socket supports IPv6
  21. /// communication only.
  22. /**
  23. * Implements the IPPROTO_IPV6/IP_V6ONLY socket option.
  24. *
  25. * @par Examples
  26. * Setting the option:
  27. * @code
  28. * asio::ip::tcp::socket socket(my_context);
  29. * ...
  30. * asio::ip::v6_only option(true);
  31. * socket.set_option(option);
  32. * @endcode
  33. *
  34. * @par
  35. * Getting the current option value:
  36. * @code
  37. * asio::ip::tcp::socket socket(my_context);
  38. * ...
  39. * asio::ip::v6_only option;
  40. * socket.get_option(option);
  41. * bool v6_only = option.value();
  42. * @endcode
  43. *
  44. * @par Concepts:
  45. * GettableSocketOption, SettableSocketOption.
  46. */
  47. #if defined(GENERATING_DOCUMENTATION)
  48. typedef implementation_defined v6_only;
  49. #elif defined(IPV6_V6ONLY)
  50. typedef asio::detail::socket_option::boolean<
  51. IPPROTO_IPV6, IPV6_V6ONLY> v6_only;
  52. #else
  53. typedef asio::detail::socket_option::boolean<
  54. asio::detail::custom_socket_option_level,
  55. asio::detail::always_fail_option> v6_only;
  56. #endif
  57. } // namespace ip
  58. } // namespace asio
  59. #include "asio/detail/pop_options.hpp"
  60. #endif // ASIO_IP_V6_ONLY_HPP