20 const std::string& host_,
21 const std::string& service,
27 hints.ai_family = AF_UNSPEC;
28 hints.ai_socktype = SOCK_STREAM;
29 hints.ai_protocol = IPPROTO_TCP;
33 auto* resolver =
new uv_getaddrinfo_t;
37 (host_.starts_with(
"[") && host_.ends_with(
"]") ?
38 host_.substr(1, host_.size() - 2) :
46 std::unique_lock<ccf::pal::Mutex> guard(pending_resolve_requests_mtx);
47 pending_resolve_requests.insert(resolver);
60 "uv_getaddrinfo for host:service [{}:{}] failed (async) with error "
66 std::unique_lock<ccf::pal::Mutex> guard(
67 pending_resolve_requests_mtx);
68 pending_resolve_requests.erase(resolver);
86 "uv_getaddrinfo for host:service [{}:{}] failed with error {}",
94 cb(resolver, rc, &hints);