Reference to the current Connection.
String address to look up.
Remote port build into the Address.
Whether to include resolved IPv6 addresses or not.
Reference "abort" flag, which -- if set -- should make the function return and the Fiber terminate.
import std.concurrency : Generator; Connection conn; conn.reset(); auto resolver = new Generator!ResolveAttempt(() => resolveFiber(conn, "irc.libera.chat", 6667, false, 10, abort)); resolver.call(); resolveloop: foreach (const attempt; resolver) { // attempt is a yielded `ResolveAttempt` with (ResolveAttempt.State) final switch (attempt.state) { case preresolve: assert(0, "shouldn't happen"); case success: // Address was resolved, the passed `conn` was modified break resolveloop; case exception: // Recoverable dealWithException(attempt.error); break; case failure: // Resolution failed without errors failGracefully(attempt.error); break; case error: // Unrecoverable dealWithError(attempt.error); return; } } // Address resolved
Given an address and a port, resolves these and populates the array of unique Address IPs inside the passed Connection.