method
request
request(sender, tout)
public
Hide source
# File lib/resolv.rb, line 644 def request(sender, tout) timelimit = Time.now + tout sender.send while true now = Time.now timeout = timelimit - now if timeout <= 0 raise ResolvTimeout end select_result = IO.select(@socks, nil, nil, timeout) if !select_result raise ResolvTimeout end begin reply, from = recv_reply(select_result[0]) rescue Errno::ECONNREFUSED, # GNU/Linux, FreeBSD Errno::ECONNRESET # Windows # No name server running on the server? # Don't wait anymore. raise ResolvTimeout end begin msg = Message.decode(reply) rescue DecodeError next # broken DNS message ignored end if s = @senders[[from,msg.id]] break else # unexpected DNS message ignored end end return msg, s.data end