method

bind_random_port

v1_9_3_392 - Show latest stable - Class: Resolv::DNS
bind_random_port(udpsock, bind_host="0.0.0.0")
public

No documentation available.

# File lib/resolv.rb, line 629
    def self.bind_random_port(udpsock, bind_host="0.0.0.0") # :nodoc:
      begin
        port = rangerand(1024..65535)
        udpsock.bind(bind_host, port)
      rescue Errno::EADDRINUSE
        retry
      end
    end