MCPcopy Create free account
hub / github.com/PerroEngine/Perro / send_to

Method send_to

perro_source/api_modules/perro_networking/src/udp.rs:31–36  ·  view source on GitHub ↗
(&self, bytes: &[u8], addr: A)

Source from the content-addressed store, hash-verified

29 }
30
31 pub fn send_to<A: ToSocketAddrs>(&self, bytes: &[u8], addr: A) -> NetResult<usize> {
32 let addr = first_addr(addr)?;
33 self.socket
34 .send_to(bytes, addr)
35 .map_err(|err| NetError::from_io(NetErrorKind::Send, err))
36 }
37
38 pub fn recv_from(&self, max_bytes: usize) -> NetResult<Option<UdpPacket>> {
39 let mut buf = vec![0_u8; max_bytes.max(1)];

Callers 2

udp_send_toMethod · 0.80

Calls 1

first_addrFunction · 0.85

Tested by 1