feat(http2): add HTTP/2 support for Client and Server

This commit is contained in:
Sean McArthur
2018-04-13 13:20:47 -07:00
parent fe1578acf6
commit c119097fd0
25 changed files with 2014 additions and 363 deletions

View File

@@ -51,12 +51,12 @@ fn main() {
println!("Listening on http://{}", srv2.incoming_ref().local_addr());
tokio::spawn(srv1.for_each(move |conn| {
tokio::spawn(conn.map(|_| ()).map_err(|err| println!("srv1 error: {:?}", err)));
tokio::spawn(conn.map_err(|err| println!("srv1 error: {:?}", err)));
Ok(())
}).map_err(|_| ()));
tokio::spawn(srv2.for_each(move |conn| {
tokio::spawn(conn.map(|_| ()).map_err(|err| println!("srv2 error: {:?}", err)));
tokio::spawn(conn.map_err(|err| println!("srv2 error: {:?}", err)));
Ok(())
}).map_err(|_| ()));

View File

@@ -83,7 +83,7 @@ fn main() {
println!("Listening on http://{} with 1 thread.", serve.incoming_ref().local_addr());
serve.map_err(|_| ()).for_each(move |conn| {
tokio::spawn(conn.map(|_| ()).map_err(|err| println!("serve error: {:?}", err)))
tokio::spawn(conn.map_err(|err| println!("serve error: {:?}", err)))
})
}));
}