From b12d32ce1cfc361255e3b938ed660a3e3d437f6d Mon Sep 17 00:00:00 2001 From: Rick Richardson Date: Mon, 21 Nov 2016 11:28:25 -0800 Subject: made send_dgram move self, made FramedUdp::new private, other clean-ups and tweaks --- examples/udp-codec.rs | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'examples/udp-codec.rs') 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 -- cgit v1.2.3