GetAddrInfoReq
GetAddrInfoReq
#include <icy/request.h>DNS resolver request to get the IP address of a hostname.
Public Methods
| Return | Name | Description |
|---|---|---|
GetAddrInfoReq inline | Construct and set req.data to this. | |
auto | resolve inline | Begin asynchronous DNS resolution of host at port. |
GetAddrInfoReq
inline
inline GetAddrInfoReq()Construct and set req.data to this.
resolve
inline
inline auto resolve(const std::string & host, int port, uv::Loop * loop)Begin asynchronous DNS resolution of host at port.
The result is delivered to callback as a [GetAddrInfoEvent](icy-uv-GetAddrInfoEvent.html#getaddrinfoevent). The addrinfo pointer in the event is freed immediately after the callback returns; do not retain it.
Parameters
hostHostname or numeric IP address string to resolve.portPort number; converted to a service string forgetaddrinfo.loopEvent loop on which to run the resolution.
Returns
true if the request was submitted successfully.
Public Static Methods
| Return | Name | Description |
|---|---|---|
void | getAddrInfoCallback static inline | libuv completion callback for uv_getaddrinfo. |
getAddrInfoCallback
static inline
static inline void getAddrInfoCallback(Request::Type * req, int status, struct addrinfo * res)libuv completion callback for uv_getaddrinfo.
Invokes the stored callback with the resolved address list, then frees the addrinfo chain and deletes the wrapper.
Parameters
reqThe completeduv_getaddrinfo_trequest.statuslibuv status code.resResolved address list (freed after callback returns).
Public Types
| Name | Description |
|---|---|
Request |
Request
uv::Request< uv_getaddrinfo_t, GetAddrInfoEvent > Request()