Dup Ver Goto 📝

Trivial UDP Send example

PT2/lang/rust/net/udp does not exist
To
13 lines, 42 words, 436 chars Page 'TrivialSend' does not exist.
// from https://doc.rust-lang.org/std/net/struct.UdpSocket.html
use std::net::UdpSocket;

fn main() {
    let socket = UdpSocket::bind("127.0.0.1:34254").expect("couldn't bind to address");
    let msg = "Hello World";
    let buf = msg.as_bytes();
    socket.send_to(&buf, "127.0.0.1:3000").expect("couldn't send data");
}

You can test this with e.g. the trivial python UDP receiver.