method
lazy_initialize
v2_5_5 -
Show latest stable
- Class:
Resolv::DNS::Requester::ConnectedUDP
lazy_initialize()public
No documentation available.
# File lib/resolv.rb, line 824
def lazy_initialize
@mutex.synchronize {
next if @initialized
@initialized = true
is_ipv6 = @host.index(':')
sock = UDPSocket.new(is_ipv6 ? Socket::AF_INET6 : Socket::AF_INET)
@socks = [sock]
sock.do_not_reverse_lookup = true
DNS.bind_random_port(sock, is_ipv6 ? "::" : "0.0.0.0")
sock.connect(@host, @port)
}
self
end