|
||||
File indexing completed on 2025-01-30 09:33:34
0001 // 0002 // ip/unicast.hpp 0003 // ~~~~~~~~~~~~~~ 0004 // 0005 // Copyright (c) 2003-2023 Christopher M. Kohlhoff (chris at kohlhoff dot com) 0006 // 0007 // Distributed under the Boost Software License, Version 1.0. (See accompanying 0008 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 0009 // 0010 0011 #ifndef BOOST_ASIO_IP_UNICAST_HPP 0012 #define BOOST_ASIO_IP_UNICAST_HPP 0013 0014 #if defined(_MSC_VER) && (_MSC_VER >= 1200) 0015 # pragma once 0016 #endif // defined(_MSC_VER) && (_MSC_VER >= 1200) 0017 0018 #include <boost/asio/detail/config.hpp> 0019 #include <cstddef> 0020 #include <boost/asio/ip/detail/socket_option.hpp> 0021 0022 #include <boost/asio/detail/push_options.hpp> 0023 0024 namespace boost { 0025 namespace asio { 0026 namespace ip { 0027 namespace unicast { 0028 0029 /// Socket option for time-to-live associated with outgoing unicast packets. 0030 /** 0031 * Implements the IPPROTO_IP/IP_UNICAST_TTL socket option. 0032 * 0033 * @par Examples 0034 * Setting the option: 0035 * @code 0036 * boost::asio::ip::udp::socket socket(my_context); 0037 * ... 0038 * boost::asio::ip::unicast::hops option(4); 0039 * socket.set_option(option); 0040 * @endcode 0041 * 0042 * @par 0043 * Getting the current option value: 0044 * @code 0045 * boost::asio::ip::udp::socket socket(my_context); 0046 * ... 0047 * boost::asio::ip::unicast::hops option; 0048 * socket.get_option(option); 0049 * int ttl = option.value(); 0050 * @endcode 0051 * 0052 * @par Concepts: 0053 * GettableSocketOption, SettableSocketOption. 0054 */ 0055 #if defined(GENERATING_DOCUMENTATION) 0056 typedef implementation_defined hops; 0057 #else 0058 typedef boost::asio::ip::detail::socket_option::unicast_hops< 0059 BOOST_ASIO_OS_DEF(IPPROTO_IP), 0060 BOOST_ASIO_OS_DEF(IP_TTL), 0061 BOOST_ASIO_OS_DEF(IPPROTO_IPV6), 0062 BOOST_ASIO_OS_DEF(IPV6_UNICAST_HOPS)> hops; 0063 #endif 0064 0065 } // namespace unicast 0066 } // namespace ip 0067 } // namespace asio 0068 } // namespace boost 0069 0070 #include <boost/asio/detail/pop_options.hpp> 0071 0072 #endif // BOOST_ASIO_IP_UNICAST_HPP
[ Source navigation ] | [ Diff markup ] | [ Identifier search ] | [ general search ] |
This page was automatically generated by the 2.3.7 LXR engine. The LXR team |