method
new

new(*nameserver_port)
public
Hide source
# File lib/resolv.rb, line 696 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] sock = UDPSocket.new(af) sock.do_not_reverse_lookup = true sock.fcntl(Fcntl::F_SETFD, Fcntl::FD_CLOEXEC) if defined? Fcntl::F_SETFD DNS.bind_random_port(sock, bind_host) @socks << sock @socks_hash[bind_host] = sock } end