summaryrefslogtreecommitdiffstats
path: root/examples/hello.rs
diff options
context:
space:
mode:
Diffstat (limited to 'examples/hello.rs')
-rw-r--r--examples/hello.rs10
1 files changed, 5 insertions, 5 deletions
diff --git a/examples/hello.rs b/examples/hello.rs
index 0bff27e9..5d1c226e 100644
--- a/examples/hello.rs
+++ b/examples/hello.rs
@@ -19,17 +19,17 @@ extern crate tokio_io;
use std::env;
use std::net::SocketAddr;
-use futures::stream::Stream;
-use tokio::reactor::Reactor;
+use futures::prelude::*;
use tokio::net::TcpListener;
+use tokio::reactor::Handle;
fn main() {
env_logger::init().unwrap();
let addr = env::args().nth(1).unwrap_or("127.0.0.1:8080".to_string());
let addr = addr.parse::<SocketAddr>().unwrap();
- let mut core = Reactor::new().unwrap();
- let listener = TcpListener::bind(&addr, &core.handle()).unwrap();
+ let handle = Handle::default();
+ let listener = TcpListener::bind(&addr, &handle).unwrap();
let addr = listener.local_addr().unwrap();
println!("Listening for connections on {}", addr);
@@ -42,5 +42,5 @@ fn main() {
Ok(())
});
- core.run(server).unwrap();
+ server.wait().unwrap();
}