'Is there a way to create an UdpSocket without bind() for just send_to()?

I'm trying to do the equivalent of this piece of Ruby:

def color=(color)
  @color = color
  any_bar = UDPSocket.new
  any_bar.connect HOSTNAME, @port
  any_bar.send @color, 0
  any_bar.close
end

I can't see any other way to initialize a UdpSocket from the Rust API documentation without bind().



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source