### Home Classes Methods

### In Files

- lib/cool.io/dns_resolver.rb

### Parent

Coolio::TimerWatcher

### Methods

- ::new
- #on_timer

### Class/Module Index

Quicksearch

- Coolio
- Coolio::AsyncWatcher
- Coolio::Connections
- Coolio::DNSResolver
- Coolio::DNSResolver::Timeout
- Coolio::DSL
- Coolio::DSL::ConnectionBuilder
- Coolio::IO
- Coolio::IO::Watcher
- Coolio::IOWatcher
- Coolio::Listener
- Coolio::Loop
- Coolio::Meta
- Coolio::Server
- Coolio::Socket
- Coolio::Socket::Connector
- Coolio::TCPListener
- Coolio::TCPServer
- Coolio::TCPSocket
- Coolio::TCPSocket::TCPConnectResolver
- Coolio::TCPSocket::TCPConnectSocket
- Coolio::TimerWatcher
- Coolio::UNIXListener
- Coolio::UNIXServer
- Coolio::UNIXSocket
- Cool
- Cool::Coolness
- Cool::IOThunk
- Object
- Thread

No matching classes.

# Coolio::DNSResolver::Timeout

### Public Class Methods

new(resolver) click to toggle source

    # File lib/cool.io/dns_resolver.rb, line 200
    def initialize(resolver)
      @resolver = resolver
      @attempts = 0
      super(TIMEOUT, true)
    end

### Public Instance Methods

on_timer() click to toggle source

    # File lib/cool.io/dns_resolver.rb, line 206
    def on_timer
      @attempts += 1
      if @attempts <= RETRIES
        begin
          return @resolver.__send__(:send_request)
        rescue Errno::EHOSTUNREACH # if the DNS is toast try again after the timeout occurs again
          return nil
        end
      end
      @resolver.__send__(:on_timeout)
      @resolver.detach
    end

[Validate]

Generated with the Darkfish Rdoc Generator 2.