Method: Net::DNS::Resolver#tcp_timeout

Defined in:
lib/net/dns/resolver.rb

#tcp_timeoutObject

Return an object representing the value of the stored TCP timeout the resolver will use in is queries. This object is an instance of the class TcpTimeout, and two methods are available for printing informations: TcpTimeout#to_s and TcpTimeout#pretty_to_s.

Here’s some example:

puts "Timeout of #{res.tcp_timeout} seconds" # implicit to_s
  #=> Timeout of 150 seconds

puts "You set a timeout of " + res.tcp_timeout.pretty_to_s
  #=> You set a timeout of 2 minutes and 30 seconds

If the timeout is infinite, a string “infinite” will be returned.



712
713
714
# File 'lib/net/dns/resolver.rb', line 712

def tcp_timeout
  @config[:tcp_timeout].to_s
end