blob: 3f19dbed5ea951d338556028eb80137fd8f789a3 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
|
extern crate utp;
use utp::UtpSocket;
fn main() {
// Bind to port 3540
let addr = "127.0.0.1:3540";
let mut socket = UtpSocket::connect(addr).expect("Error connecting to remote peer");
// Send a string
socket.send_to("Hi there!".as_bytes()).expect("Write failed");
// Close the socket
socket.close().expect("Error closing connection");
}
|