Boost C++ Libraries

...one of the most highly regarded and expertly designed C++ library projects in the world. Herb Sutter and Andrei Alexandrescu, C++ Coding Standards

This is the documentation for a snapshot of the master branch, built from commit c6a8213e9b.
PrevUpHomeNext

ip::multicast::hops

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

typedef implementation_defined hops;

Implements the IPPROTO_IP/IP_MULTICAST_TTL socket option.

Examples

Setting the option:

boost::asio::ip::udp::socket socket(my_context);
...
boost::asio::ip::multicast::hops option(4);
socket.set_option(option);

Getting the current option value:

boost::asio::ip::udp::socket socket(my_context);
...
boost::asio::ip::multicast::hops option;
socket.get_option(option);
int ttl = option.value();
Requirements

Header: boost/asio/ip/multicast.hpp

Convenience header: boost/asio.hpp


PrevUpHomeNext