summaryrefslogtreecommitdiffstats
path: root/examples/chat.rs
diff options
context:
space:
mode:
authorAlex Crichton <alex@alexcrichton.com>2017-12-12 18:32:50 -0600
committerCarl Lerche <me@carllerche.com>2017-12-12 18:32:50 -0600
commit4ef772b2db9fdf19625e428f1031409994b4c8e6 (patch)
tree35d3bd529eedbab426130edde1c9dbc71ff5d80f /examples/chat.rs
parent849771ecfa1e22fdd4f0bd299d10f0026ce14ed5 (diff)
Remove `Handle` argument from I/O constructors (#61)
This commit removes the `Handle` argument from the following constructors * `TcpListener::bind` * `TcpStream::connect` * `UdpSocket::bind` The `Handle` argument remains on the various `*_std` constructors as they're more low-level, but this otherwise is intended to set forth a precedent of by default not taking `Handle` arguments and instead relying on the global `Handle::default` return value when necesary.
Diffstat (limited to 'examples/chat.rs')
-rw-r--r--examples/chat.rs4
1 files changed, 1 insertions, 3 deletions
diff --git a/examples/chat.rs b/examples/chat.rs
index d7d84669..d141f62b 100644
--- a/examples/chat.rs
+++ b/examples/chat.rs
@@ -33,7 +33,6 @@ use futures::future::Executor;
use futures::stream::{self, Stream};
use futures_cpupool::CpuPool;
use tokio::net::TcpListener;
-use tokio::reactor::Handle;
use tokio_io::io;
use tokio_io::AsyncRead;
@@ -42,8 +41,7 @@ fn main() {
let addr = addr.parse().unwrap();
// Create the TCP listener we'll accept connections on.
- let handle = Handle::default();
- let socket = TcpListener::bind(&addr, &handle).unwrap();
+ let socket = TcpListener::bind(&addr).unwrap();
println!("Listening on: {}", addr);
// This is currently a multi threaded server.