made send_dgram move self, made FramedUdp::new private, other clean-ups and tweaks

This commit is contained in:
Rick Richardson
2016-11-21 11:28:25 -08:00
parent ab3915d47d
commit b12d32ce1c
3 changed files with 22 additions and 38 deletions
+4 -6
View File
@@ -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