Switch udp socket type based on whether address found is v4 ot v6