In UDP there is no handshaking mecanism, so there is no automatic way to know if your message has been received.
If you want to use UDP and keep track of the "connection" state, the other side must send some packet from time to time (some kind of keepalive signal) or also, respond to some of the packets you send according to some predefined protocol
Otherwise, it's better to use TCP