(
addr: T,
reuse: bool,
buf_size: usize,
)
| 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, |
nothing calls this directly
no test coverage detected