(target: &str)
| 155 | } |
| 156 | |
| 157 | async fn test_target(target: &str) -> ResultType<SocketAddr> { |
| 158 | if let Ok(Ok(s)) = super::timeout(1000, tokio::net::TcpStream::connect(target)).await { |
| 159 | if let Ok(addr) = s.peer_addr() { |
| 160 | return Ok(addr); |
| 161 | } |
| 162 | } |
| 163 | tokio::net::lookup_host(target) |
| 164 | .await? |
| 165 | .next() |
| 166 | .context(format!("Failed to look up host for {target}")) |
| 167 | } |
| 168 | |
| 169 | #[inline] |
| 170 | pub async fn new_udp_for( |
no test coverage detected