154 {
155 AddrinfoAwaiter_ awaiter;
156 awaiter.req_.data = &awaiter;
157 struct addrinfo hints {};
158 hints.ai_family = af_hint;
159 hints.ai_socktype = SOCK_STREAM;
160
162 port.data(), &hints);
163
164 struct addrinfo *result = co_await awaiter;
165
166 uv_status status = awaiter.status_.value();
167 if (status != 0) {
168 throw UvcoException{status, "getaddrinfo()"};
169 }
170
171 AddressHandle address{result};
172 uv_freeaddrinfo(result);
173
174 co_return address;
175}
uv_loop_t * uvloop() const
Get a non-owned pointer to the loop.
Definition loop.cc:62
static void onAddrinfo(uv_getaddrinfo_t *req, uv_status status, struct addrinfo *result)
Definition name_resolution.cc:177
int uv_status
Result of a libuv operation, an errno error code.
Definition internal_utils.h:22