我试着做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
如果没有bind()
,我想不出其他办法来达到initialize a UdpSocket
from the Rust API documentation.