diff options
author | Alex Crichton <alex@alexcrichton.com> | 2017-12-12 18:32:50 -0600 |
---|---|---|
committer | Carl Lerche <me@carllerche.com> | 2017-12-12 18:32:50 -0600 |
commit | 4ef772b2db9fdf19625e428f1031409994b4c8e6 (patch) | |
tree | 35d3bd529eedbab426130edde1c9dbc71ff5d80f /examples/echo-udp.rs | |
parent | 849771ecfa1e22fdd4f0bd299d10f0026ce14ed5 (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/echo-udp.rs')
-rw-r--r-- | examples/echo-udp.rs | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/examples/echo-udp.rs b/examples/echo-udp.rs index 0bcc3807..f7e2bf09 100644 --- a/examples/echo-udp.rs +++ b/examples/echo-udp.rs @@ -20,7 +20,6 @@ use std::net::SocketAddr; use futures::{Future, Poll}; use tokio::net::UdpSocket; -use tokio::reactor::Handle; struct Server { socket: UdpSocket, @@ -54,8 +53,7 @@ fn main() { let addr = env::args().nth(1).unwrap_or("127.0.0.1:8080".to_string()); let addr = addr.parse::<SocketAddr>().unwrap(); - let handle = Handle::default(); - let socket = UdpSocket::bind(&addr, &handle).unwrap(); + let socket = UdpSocket::bind(&addr).unwrap(); println!("Listening on: {}", socket.local_addr().unwrap()); // Next we'll create a future to spawn (the one we defined above) and then |