summaryrefslogtreecommitdiffstats
path: root/examples/udp-codec.rs
diff options
context:
space:
mode:
authorRick Richardson <rick.richardson@gmail.com>2016-11-21 11:28:25 -0800
committerRick Richardson <rick.richardson@gmail.com>2016-11-21 11:28:25 -0800
commitb12d32ce1cfc361255e3b938ed660a3e3d437f6d (patch)
treeb52518ea593f4e4adce0eb581c563bef3506bf82 /examples/udp-codec.rs
parentab3915d47d607a3e3585b8270d8ecb69d7a4249e (diff)
made send_dgram move self, made FramedUdp::new private, other clean-ups and tweaks
Diffstat (limited to 'examples/udp-codec.rs')
-rw-r--r--examples/udp-codec.rs10
1 files changed, 4 insertions, 6 deletions
diff --git a/examples/udp-codec.rs b/examples/udp-codec.rs
index 230c98ff..f899180a 100644
--- a/examples/udp-codec.rs
+++ b/examples/udp-codec.rs
@@ -69,12 +69,10 @@ fn main() {
let client = UdpSocket::bind(&clientaddr, &handle).unwrap();
//start things off by sending a ping from the client to the server
- //This doesn't go through the codec to encode the message, but rather
- //it sends raw data with the send_dgram future
- {
- let job = client.send_dgram(b"PING\n", &srvaddr);
- core.run(job).unwrap();
- }
+ //This doesn't utilize the codec to encode the message, but rather
+ //it sends raw data directly to the remote peer with the send_dgram future
+ let job = client.send_dgram(b"PING\n", srvaddr);
+ let (client, _buf) = core.run(job).unwrap();
//We create a FramedUdp instance, which associates a socket
//with a codec. We then immediate split that into the