Also, you're using connect for UDP, which doesn't really connect but associates the socket with a specific destination address-port tuple. So if the server uses a source address or port different than the one you're connecting, then the UDP stack will drop the message.
Maybe in Wireshark you can check the exact source address and port of the incoming message from the server.