Asynchronous name resolution utilities for the futures
and tokio-core
crates. Look at the crate-level documentation for more details.
This library has been packaged to crates.io. Note that its name on crates.io is tokio-dns-unofficial
, but the crate's name is tokio_dns
(when using extern crate ...
).
IpAdrr
, SocketAddr
, and port
to the ToEndpoint
trait.rustc
regression, thanks @mehcode .tokio
crate.tokio
's API.resolve
free function to resolve a hostname asynchronously using the default resolver.```rust // Taken from examples/basic.rs use tokio_dns::TcpStream;
// connect using the built-in resolver. let conn = TcpStream::connect("rust-lang.org:80").andthen(|sock| { println!("conncted to {}", sock.peeraddr().unwrap()); Ok(()) }); ```