20 const std::string& host_,
21 const std::string& service,
26 struct addrinfo hints;
27 hints.ai_family = AF_UNSPEC;
28 hints.ai_socktype = SOCK_STREAM;
29 hints.ai_protocol = IPPROTO_TCP;
32 auto resolver =
new uv_getaddrinfo_t;
36 (host_.starts_with(
"[") && host_.ends_with(
"]") ?
37 host_.substr(1, host_.size() - 2) :
45 std::unique_lock<ccf::pal::Mutex> guard(pending_resolve_requests_mtx);
46 pending_resolve_requests.insert(resolver);
59 "uv_getaddrinfo for host:service [{}:{}] failed (async) with error "
65 std::unique_lock<ccf::pal::Mutex> guard(
66 pending_resolve_requests_mtx);
67 pending_resolve_requests.erase(resolver);
85 "uv_getaddrinfo for host:service [{}:{}] failed with error {}",
93 cb(resolver, rc, &hints);