1 2 3 4 5 6 7 8 9
use std::io; use std::net::UdpSocket; pub fn send_udp(message: &str) -> io::Result<()> { let socket = UdpSocket::bind("0.0.0.0:0")?; let destino = "127.0.0.1:8080"; socket.send_to(message.as_bytes(), destino)?; Ok(()) }