pub trait VirtualUdpSocket: VirtualConnectedSocket + VirtualConnectionlessSocket + Debug + Send + Sync + 'static {
Show 14 methods fn connect(&mut self, addr: SocketAddr) -> Result<()>; fn set_broadcast(&mut self, broadcast: bool) -> Result<()>; fn broadcast(&self) -> Result<bool>; fn set_multicast_loop_v4(&mut self, val: bool) -> Result<()>; fn multicast_loop_v4(&self) -> Result<bool>; fn set_multicast_loop_v6(&mut self, val: bool) -> Result<()>; fn multicast_loop_v6(&self) -> Result<bool>; fn set_multicast_ttl_v4(&mut self, ttl: u32) -> Result<()>; fn multicast_ttl_v4(&self) -> Result<u32>; fn join_multicast_v4(
        &mut self,
        multiaddr: Ipv4Addr,
        iface: Ipv4Addr
    ) -> Result<()>; fn leave_multicast_v4(
        &mut self,
        multiaddr: Ipv4Addr,
        iface: Ipv4Addr
    ) -> Result<()>; fn join_multicast_v6(&mut self, multiaddr: Ipv6Addr, iface: u32) -> Result<()>; fn leave_multicast_v6(
        &mut self,
        multiaddr: Ipv6Addr,
        iface: u32
    ) -> Result<()>; fn addr_peer(&self) -> Result<Option<SocketAddr>>;
}

Required Methods§

Connects to a destination peer so that the normal send/recv operations can be used.

Sets a flag that means that the UDP socket is able to receive and process broadcast packets.

Indicates if the SO_BROADCAST flag is set which means that the UDP socket will receive and process broadcast packets

Sets a flag that indicates if multicast packets that this socket is a member of will be looped back to the sending socket. This applies to IPv4 addresses

Gets a flag that indicates if multicast packets that this socket is a member of will be looped back to the sending socket. This applies to IPv4 addresses

Sets a flag that indicates if multicast packets that this socket is a member of will be looped back to the sending socket. This applies to IPv6 addresses

Gets a flag that indicates if multicast packets that this socket is a member of will be looped back to the sending socket. This applies to IPv6 addresses

Sets the TTL for IPv4 multicast packets which is the number of network hops before the packet is dropped

Gets the TTL for IPv4 multicast packets which is the number of network hops before the packet is dropped

Tells this interface that it will subscribe to a particular multicast address. This applies to IPv4 addresses

Tells this interface that it will unsubscribe to a particular multicast address. This applies to IPv4 addresses

Tells this interface that it will subscribe to a particular multicast address. This applies to IPv6 addresses

Tells this interface that it will unsubscribe to a particular multicast address. This applies to IPv6 addresses

Returns the remote address of this UDP socket if it has been connected to a specific target destination address

Implementors§