Class: RubyDNS::UDPHandler

Inherits:
UDPSocketHandler show all
Defined in:
lib/rubydns/handler.rb

Instance Method Summary collapse

Methods inherited from UDPSocketHandler

#handle_connection, #respond, #run

Methods inherited from GenericHandler

#error_response, #process_query

Constructor Details

#initialize(server, host, port) ⇒ UDPHandler

Returns a new instance of UDPHandler.



126
127
128
129
130
131
132
133
# File 'lib/rubydns/handler.rb', line 126

def initialize(server, host, port)
  family = RubyDNS::address_family(host)
  socket = UDPSocket.new(family)
  
  socket.bind(host, port)
  
  super(server, socket)
end

Instance Method Details

#finalizeObject



137
138
139
# File 'lib/rubydns/handler.rb', line 137

def finalize
  @socket.close if @socket
end