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 address passed from lib.rs — listens on all interfaces on the chosen port
socket()returns a clonedArcto the socket for use in other tasks
socket2 allows to customize the socket, otherwise the buffer size will be set by the system and be too small
No comments to display
No comments to display