Boost  v1.57.0
doxygen for www.boost.org
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
boost::asio::ip::unicast Namespace Reference

Typedefs

typedef
boost::asio::ip::detail::socket_option::unicast_hops
< BOOST_ASIO_OS_DEF(IPPROTO_IP),
BOOST_ASIO_OS_DEF(IP_TTL),
BOOST_ASIO_OS_DEF(IPPROTO_IPV6),
BOOST_ASIO_OS_DEF(IPV6_UNICAST_HOPS)> 
hops
 Socket option for time-to-live associated with outgoing unicast packets. More...
 

Typedef Documentation

typedef boost::asio::ip::detail::socket_option::unicast_hops< BOOST_ASIO_OS_DEF(IPPROTO_IP), BOOST_ASIO_OS_DEF(IP_TTL), BOOST_ASIO_OS_DEF(IPPROTO_IPV6), BOOST_ASIO_OS_DEF(IPV6_UNICAST_HOPS)> boost::asio::ip::unicast::hops

Socket option for time-to-live associated with outgoing unicast packets.

Implements the IPPROTO_IP/IP_UNICAST_TTL socket option.

Examples
Setting the option:
boost::asio::ip::udp::socket socket(io_service);
...
boost::asio::ip::unicast::hops option(4);
socket.set_option(option);
Getting the current option value:
boost::asio::ip::udp::socket socket(io_service);
...
boost::asio::ip::unicast::hops option;
socket.get_option(option);
int ttl = option.value();
Concepts:
GettableSocketOption, SettableSocketOption.