Skip to main content

service.rs — UDP Socket

UdpService is a thin wrapper that binds a UDP socket and holds it in an Arc<UdpSocket> so it can be shared across async tasks. It is registered as Tauri managed state at startup so any command can access the socket via State<'_, UdpService>.

  • Binds to 0.0.0.0:9000 — listens on all interfaces, port 9000
  • socket() returns a cloned Arc to the socket for use in other tasks