Server programs no longer exit immediately.

This commit is contained in:
Aaron Weiss
2014-12-21 16:23:48 -05:00
parent f9ed262904
commit be6cc34caf
2 changed files with 14 additions and 4 deletions

View File

@@ -52,6 +52,7 @@ fn echo(mut req: Request, mut res: Response) {
fn main() {
let server = Server::http(Ipv4Addr(127, 0, 0, 1), 1337);
server.listen(echo).unwrap();
let mut listening = server.listen(echo).unwrap();
println!("Listening on http://127.0.0.1:1337");
listening.await();
}