method

lazy_initialize

Importance_0
v2_6_3 - Show latest stable - 0 notes - Class: Resolv::DNS::Requester::ConnectedUDP
lazy_initialize() public

No documentation

This method has no description. You can help the Ruby community by adding new notes.

Hide source
# File lib/resolv.rb, line 812
        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
Register or log in to add new notes.