This commit is contained in:
Michael Zhang 2023-08-10 23:19:47 -05:00
parent c58eb32cc3
commit ae90df49c1

View file

@ -84,16 +84,12 @@ async fn main() -> Result<()> {
let service = app.into_make_service();
let addr4 = SocketAddr::from((Ipv4Addr::UNSPECIFIED, opts.port));
let addr6 = SocketAddr::from((Ipv6Addr::UNSPECIFIED, opts.port));
println!("Listening on {} and {}...", addr4, addr6);
println!("Listening on {}...", addr6);
let server4 = Server::bind(&addr4).serve(service.clone());
let server6 = Server::bind(&addr6).serve(service);
let (result4, result6) = join!(server4, server6);
result4?;
result6?;
server6.await?;
Ok(())
}