Struct asio::ip::MulticastEnableLoopback [] [src]

pub struct MulticastEnableLoopback(_);

Socket option determining whether outgoing multicast packets will be received on the same socket if it is a member of the multicast group.

Implements the IPPROTO_IP/IP_MULTICAST_LOOP or IPPROTO_IPV6/IPV6_MULTICAST_LOOP socket option.

Examples

Setting the option:

use asio::*;
use asio::ip::*;

let io = &IoService::new();
let soc = UdpSocket::new(io, Udp::v4()).unwrap();

soc.set_option(MulticastEnableLoopback::new(true)).unwrap();

Getting the option:

use asio::*;
use asio::ip::*;

let io = &IoService::new();
let soc = UdpSocket::new(io, Udp::v4()).unwrap();

let opt: MulticastEnableLoopback = soc.get_option().unwrap();
let is_set: bool = opt.get();

Methods

impl MulticastEnableLoopback
[src]

fn new(on: bool) -> MulticastEnableLoopback

fn get(&self) -> bool

fn set(&mut self, on: bool)

Trait Implementations

impl Clone for MulticastEnableLoopback
[src]

fn clone(&self) -> MulticastEnableLoopback

Returns a copy of the value. Read more

fn clone_from(&mut self, source: &Self)
1.0.0

Performs copy-assignment from source. Read more

impl Default for MulticastEnableLoopback
[src]

fn default() -> MulticastEnableLoopback

Returns the "default value" for a type. Read more

impl<P: IpProtocol> SocketOption<P> for MulticastEnableLoopback
[src]

type Data = i32

fn level(&self, pro: &P) -> i32

fn name(&self, pro: &P) -> i32

impl<P: IpProtocol> GetSocketOption<P> for MulticastEnableLoopback
[src]

fn data_mut(&mut self) -> &mut Self::Data

fn resize(&mut self, _size: usize)

impl<P: IpProtocol> SetSocketOption<P> for MulticastEnableLoopback
[src]

fn data(&self) -> &Self::Data

fn size(&self) -> usize