Class: RubyDNS::UDPHandler
- Inherits:
-
UDPSocketHandler
- Object
- GenericHandler
- UDPSocketHandler
- RubyDNS::UDPHandler
- Defined in:
- lib/rubydns/handler.rb
Instance Method Summary collapse
- #finalize ⇒ Object
-
#initialize(server, host, port) ⇒ UDPHandler
constructor
A new instance of UDPHandler.
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
#finalize ⇒ Object
137 138 139 |
# File 'lib/rubydns/handler.rb', line 137 def finalize @socket.close if @socket end |