DNS utilities.
| Return | Name | Description |
|---|---|---|
auto | resolve inline | Resolves a hostname to a network address asynchronously. |
inline
inline auto resolve(const std::string & host, int port, std::function< void(int, const net::Address &)> callback, uv::Loop * loop)Resolves a hostname to a network address asynchronously.
The callback is invoked on the event loop thread when resolution completes. On failure, the callback receives a non-zero status and an empty Address.
host Hostname or IP address string to resolve.
port Port number to associate with the resolved address.
callback Invoked with (status, resolved Address); status is 0 on success.
loop Event loop to use; defaults to the default loop.
A request handle whose lifetime controls the in-flight DNS query.