net.DialUDP gives a connected UPD socket, i.e. one that will read ICMP Unreachable packets. That's the opposite of what we want: we want to periodically send out a packet, and then just read from the connection to see when we get a Version Negotiation packet as a response.
net.DialUDP
gives a connected UPD socket, i.e. one that will read ICMP Unreachable packets. That's the opposite of what we want: we want to periodically send out a packet, and then just read from the connection to see when we get a Version Negotiation packet as a response.