DNS resolver and connector utility actor
use actix::prelude::*;
use actix::actors::resolver;
fn main() {
System::run(|| {
tokio::spawn({
let resolver = resolver::Resolver::from_registry();
resolver.send(
resolver::Resolve::host("localhost"))
.then(|addrs| {
println!("RESULT: {:?}", addrs);
Ok::<_, ()>(())
})
});
tokio::spawn({
let resolver = resolver::Resolver::from_registry();
resolver.send(
resolver::Connect::host_and_port("localhost", 5000))
.then(|stream| {
println!("RESULT: {:?}", stream);
Ok::<_, ()>(())
})
});
});
}