I would try ::bind("0.0.0.0:0")- this should let O / S choose the IP / port for you. This may be good enough for a transition socket to send a simple datagram with.
Note. This also happens when using send_to on unconnected UDP sockets, for example. using fd returned from the socket () system call without calling bind () - O / S allocates the IP / port for sending your datagram.