feat(server): add server::Serve that can use a shared Handle
- Adds `Http::serve_addr_handle` which will bind to an address with a provided `Handle`, and return a `Serve`. - Adds `server::Serve` which is a `Stream` of incoming `Connection`s being bound by a `NewService`. - Renames `Http::no_proto` to `Http::serve_connection`.
This commit is contained in:
@@ -524,7 +524,7 @@ fn no_proto_empty_parse_eof_does_not_return_error() {
|
||||
.map_err(|_| unreachable!())
|
||||
.and_then(|(item, _incoming)| {
|
||||
let (socket, _) = item.unwrap();
|
||||
Http::new().no_proto(socket, HelloWorld)
|
||||
Http::<hyper::Chunk>::new().serve_connection(socket, HelloWorld)
|
||||
});
|
||||
|
||||
core.run(fut).unwrap();
|
||||
@@ -546,7 +546,7 @@ fn no_proto_nonempty_parse_eof_returns_error() {
|
||||
.map_err(|_| unreachable!())
|
||||
.and_then(|(item, _incoming)| {
|
||||
let (socket, _) = item.unwrap();
|
||||
Http::new().no_proto(socket, HelloWorld)
|
||||
Http::<hyper::Chunk>::new().serve_connection(socket, HelloWorld)
|
||||
.map(|_| ())
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user