boost::corosio::socket_option::multicast_loop

Enable loopback of outgoing multicast (IP_MULTICAST_LOOP / IPV6_MULTICAST_LOOP).

Synopsis

class multicast_loop;

Description

The socket's family selects the wire rendering. A single byte at the IPv4 level (BSD‐derived kernels reject the four‐byte form), an int at the IPv6 level.

Example

void
loop_multicast_back_to_this_host(corosio::udp_socket& sock)
{
    // Works for a socket of either family; the option renders for
    // the family the socket was opened with.
    //
    // Enabled, datagrams this socket sends are also delivered to members of
    // the group on this same host, the sending process included. Disable it
    // when a sender must not receive its own traffic.
    sock.set_option(corosio::socket_option::multicast_loop(true));
}

Member Functions

Name

Description

multicast_loop [constructor]

Constructors

operator=

Assign a new value.

value

Return the option value.

Created with MrDocs