Last active
August 29, 2015 14:23
-
-
Save ethan-tqa/85f367c000115bfe5faa to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #[test] | |
| fn test_net() | |
| { | |
| let server_port = 12321; | |
| let mut serverSock = UdpSocket::bind(("127.0.0.1", server_port)).unwrap(); | |
| let mut clientSock = UdpSocket::bind(("0.0.0.0:0")).unwrap(); | |
| clientSock.send_to("Hello World\r\n".as_bytes(), (Ipv4Addr::new(127, 0, 0, 1), server_port)); | |
| println!("lol"); | |
| let mut buf = [0; 20]; | |
| serverSock.recv_from(&mut buf); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment