Skip to content

Commit 0846c96

Browse files
committed
Update hostname resolution to use asynchronous lookup with Tokio
1 parent 337f496 commit 0846c96

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/dht.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ use log::{debug, error, info, trace, warn};
1515
const BOOTSTRAP_HOSTS: &[&str] = &["router.bittorrent.com:6881", "router.utorrent.com:6881", "dht.transmissionbt.com:6881", "dht.aelitis.com:6881"];
1616

1717
async fn resolve_hostname(hostname: &str, want_v4: bool) -> Option<SocketAddr> {
18-
match std::net::ToSocketAddrs::to_socket_addrs(&hostname) {
18+
match tokio::net::lookup_host(hostname).await {
1919
Ok(addrs) => {
2020
for a in addrs {
2121
if a.is_ipv4() == want_v4 {

0 commit comments

Comments
 (0)