method
new

new(*nameserver_port)
public
Hide source
# File lib/resolv.rb, line 732 def initialize(*nameserver_port) super() @nameserver_port = nameserver_port @socks_hash = {} @socks = [] nameserver_port.each {|host, port| if host.index(':') bind_host = "::" af = Socket::AF_INET6 else bind_host = "0.0.0.0" af = Socket::AF_INET end next if @socks_hash[bind_host] begin sock = UDPSocket.new(af) rescue Errno::EAFNOSUPPORT next # The kernel doesn't support the address family. end sock.do_not_reverse_lookup = true DNS.bind_random_port(sock, bind_host) @socks << sock @socks_hash[bind_host] = sock } end