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

Function test_target

libs/hbb_common/src/socket_client.rs:157–167  ·  view source on GitHub ↗
(target: &str)

Source from the content-addressed store, hash-verified

155}
156
157async 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]
170pub async fn new_udp_for(

Callers 2

new_udp_forFunction · 0.85
rebind_udp_forFunction · 0.85

Calls 2

timeoutFunction · 0.85
nextMethod · 0.45

Tested by

no test coverage detected