summaryrefslogtreecommitdiffstats
path: root/examples/udp-codec.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/udp-codec.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/udp-codec.rs')
-rw-r--r--examples/udp-codec.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/examples/udp-codec.rs b/examples/udp-codec.rs
index a2429e49..be686d63 100644
--- a/examples/udp-codec.rs
+++ b/examples/udp-codec.rs
@@ -17,7 +17,7 @@ use std::net::SocketAddr;
use futures::{Future, Stream, Sink};
use futures::future::Executor;
use futures_cpupool::CpuPool;
-use tokio::net::UdpSocket;
+use tokio::net::{UdpSocket, UdpFramed};
use tokio_io::codec::BytesCodec;
fn main() {
@@ -34,8 +34,8 @@ fn main() {
// We're parsing each socket with the `LineCodec` defined above, and then we
// `split` each codec into the sink/stream halves.
- let (a_sink, a_stream) = a.framed(BytesCodec::new()).split();
- let (b_sink, b_stream) = b.framed(BytesCodec::new()).split();
+ let (a_sink, a_stream) = UdpFramed::new(a, BytesCodec::new()).split();
+ let (b_sink, b_stream) = UdpFramed::new(b, BytesCodec::new()).split();
// Start off by sending a ping from a to b, afterwards we just print out
// what they send us and continually send pings