pub struct MulticastServer { /* private fields */ }
Expand description
A UDP server.
After creating a UdpSocket by binding it to a socket address, data can be sent to and received from any other socket address.
Although UDP is a connectionless protocol, this implementation provides an interface to set an address where data should be sent and received from. After setting a remote address with connect, data can be sent to and received from that address with send and recv.
As stated in the User Datagram Protocol’s specification in IETF RFC 768, UDP is an unordered, unreliable protocol;
This server is used to send multicast packets to all members of a multicast group.
Implementations§
Source§impl Server
impl Server
Sourcepub fn new(
multicast: Ipv4Addr,
bind: SocketAddr,
mtu: usize,
) -> Result<Self, Error>
pub fn new( multicast: Ipv4Addr, bind: SocketAddr, mtu: usize, ) -> Result<Self, Error>
Creates a UDP socket from the given address.
You need to specify the multicast group for the udp session to join to the specified multicast group.
Note that only IPV4 is supported.
MTU is used to specify the network unit size, this is used to limit the maximum size of packets sent.