Skip to content

Commit

Permalink
fix comment, explicitely configure concurrent requests
Browse files Browse the repository at this point in the history
  • Loading branch information
divagant-martian committed May 14, 2024
1 parent 5c815ac commit 7b44746
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions iroh-net/src/dns.rs
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,12 @@ fn create_default_resolver() -> Result<TokioAsyncResolver> {
}
}

// lookup IPv4 and IPv6 in parallel
options.ip_strategy = hickory_resolver::config::LookupIpStrategy::Ipv4AndIpv6;
// ensure multiple name servers are queried concurrently
options.num_concurrent_reqs = 3;
options.timeout = std::time::Duration::from_millis(450);

// see [`lookup_ipv4_ipv6`] for info on why we avoid LookupIpStrategy::Ipv4AndIpv6
options.ip_strategy = hickory_resolver::config::LookupIpStrategy::Ipv4thenIpv6;

let resolver = AsyncResolver::tokio(config, options);
Ok(resolver)
Expand Down

0 comments on commit 7b44746

Please sign in to comment.