Method: Net::DNS::Resolver#udp_timeout
- Defined in:
- lib/net/dns/resolver.rb
#udp_timeout ⇒ Object
Return an object representing the value of the stored UDP timeout the resolver will use in is queries. This object is an instance of the class UdpTimeout, and two methods are available for printing information: UdpTimeout#to_s and UdpTimeout#pretty_to_s.
Here’s some example:
puts "Timeout of #{res.udp_timeout} seconds" # implicit to_s
#=> Timeout of 150 seconds
puts "You set a timeout of " + res.udp_timeout.pretty_to_s
#=> You set a timeout of 2 minutes and 30 seconds
If the timeout is zero, a string “not defined” will be returned.
775 776 777 |
# File 'lib/net/dns/resolver.rb', line 775 def udp_timeout @config[:udp_timeout].to_s end |