pub trait VirtualConnectionlessSocket: VirtualSocket + Debug + Send + Sync + 'static {
fn send_to(&mut self, data: Bytes, addr: SocketAddr) -> Result<usize>;
fn recv_from(&mut self) -> Result<SocketReceiveFrom>;
fn peek_from(&mut self) -> Result<SocketReceiveFrom>;
}
Expand description
Connectionless sockets are able to send and receive datagrams and stream bytes to multiple addresses at the same time (peer-to-peer)
Required Methods§
sourcefn send_to(&mut self, data: Bytes, addr: SocketAddr) -> Result<usize>
fn send_to(&mut self, data: Bytes, addr: SocketAddr) -> Result<usize>
Sends out a datagram or stream of bytes on this socket to a specific address
sourcefn recv_from(&mut self) -> Result<SocketReceiveFrom>
fn recv_from(&mut self) -> Result<SocketReceiveFrom>
Recv a packet from the socket
sourcefn peek_from(&mut self) -> Result<SocketReceiveFrom>
fn peek_from(&mut self) -> Result<SocketReceiveFrom>
Peeks for a packet from the socket