MCPcopy Create free account
hub / github.com/Recordscript/recordscript / new_reuse

Method new_reuse

libs/hbb_common/src/udp.rs:52–65  ·  view source on GitHub ↗
(
        addr: T,
        reuse: bool,
        buf_size: usize,
    )

Source from the content-addressed store, hash-verified

50 }
51
52 pub async fn new_reuse<T: ToSocketAddrs>(
53 addr: T,
54 reuse: bool,
55 buf_size: usize,
56 ) -> ResultType<Self> {
57 let addr = lookup_host(&addr)
58 .await?
59 .next()
60 .context("could not resolve to any address")?;
61 Ok(Self::Direct(UdpFramed::new(
62 UdpSocket::from_std(new_socket(addr, reuse, buf_size)?.into_udp_socket())?,
63 BytesCodec::new(),
64 )))
65 }
66
67 pub async fn new_proxy<'a, 't, P: ToProxyAddrs, T: ToSocketAddrs>(
68 proxy: P,

Callers

nothing calls this directly

Calls 2

new_socketFunction · 0.70
nextMethod · 0.45

Tested by

no test coverage detected