method
new
v1_9_2_180 -
Show latest stable
- Class:
Resolv::DNS::Requester::ConnectedUDP
new(host, port=Port)public
No documentation available.
# File lib/resolv.rb, line 733
def initialize(host, port=Port)
super()
@host = host
@port = port
is_ipv6 = host.index(':')
sock = UDPSocket.new(is_ipv6 ? Socket::AF_INET6 : Socket::AF_INET)
@socks = [sock]
sock.do_not_reverse_lookup = true
sock.fcntl(Fcntl::F_SETFD, Fcntl::FD_CLOEXEC) if defined? Fcntl::F_SETFD
DNS.bind_random_port(sock, is_ipv6 ? "::" : "0.0.0.0")
sock.connect(host, port)
end