summaryrefslogtreecommitdiffstats
path: root/examples/connect.rs
diff options
context:
space:
mode:
authorCarl Lerche <me@carllerche.com>2018-02-07 10:42:27 -0800
committerGitHub <noreply@github.com>2018-02-07 10:42:27 -0800
commitc30fa62ddafa3fdf9a2af96ed2d2c6a20397e7c2 (patch)
treee9b91123689e34807147b89d456d9a6474436549 /examples/connect.rs
parentad8338e4da63f659acce89284381d08a2474f85b (diff)
Remove `framed` fn from `UdpSocket` (#116)
Instead, use `UdpFramed::new` to create a framed wrapper around the UDP socket.
Diffstat (limited to 'examples/connect.rs')
-rw-r--r--examples/connect.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/examples/connect.rs b/examples/connect.rs
index 275864d1..26614b96 100644
--- a/examples/connect.rs
+++ b/examples/connect.rs
@@ -170,7 +170,7 @@ mod udp {
use futures::{Future, Stream};
use futures::future::Executor;
use futures_cpupool::CpuPool;
- use tokio::net::UdpSocket;
+ use tokio::net::{UdpSocket, UdpFramed};
use codec::Bytes;
pub fn connect(&addr: &SocketAddr,
@@ -192,7 +192,7 @@ mod udp {
// this UDP socket into a framed sink/stream which operates over
// discrete values. In this case we're working with *pairs* of socket
// addresses and byte buffers.
- let (sink, stream) = udp.framed(Bytes).split();
+ let (sink, stream) = UdpFramed::new(udp, Bytes).split();
// All bytes from `stdin` will go to the `addr` specified in our
// argument list. Like with TCP this is spawned concurrently