Only send packets via UDP if UDP communication is possible.