Networking TS

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:

std::experimental::net::ip::udp::socket socket(io_context);
...
std::experimental::net::ip::multicast::hops option(4);
socket.set_option(option);

Getting the current option value:

std::experimental::net::ip::udp::socket socket(io_context);
...
std::experimental::net::ip::multicast::hops option;
socket.get_option(option);
int ttl = option.value();

PrevUpHomeNext