Class: Unbound::Resolver
- Inherits:
-
Object
- Object
- Unbound::Resolver
- Defined in:
- lib/unbound/resolver.rb
Instance Method Summary collapse
- #cancel(async_id) ⇒ Object
- #close ⇒ Object
- #fd ⇒ Object
-
#initialize ⇒ Resolver
constructor
A new instance of Resolver.
- #process ⇒ Object
- #query(name, rrtype, rrclass, callback, private_data = nil) ⇒ Object
Constructor Details
#initialize ⇒ Resolver
Returns a new instance of Resolver.
7 8 9 10 11 12 13 14 |
# File 'lib/unbound/resolver.rb', line 7 def initialize() @ctx = Unbound::Context.new @ctx.load_config("unbound/etc/unbound.conf") cb = Proc.new { |a,b,c| nil } self.query("localhost", 1, 1, cb) @ctx.wait() end |
Instance Method Details
#cancel(async_id) ⇒ Object
28 29 30 |
# File 'lib/unbound/resolver.rb', line 28 def cancel(async_id) @ctx.cancel_async_query(async_id) end |
#close ⇒ Object
16 17 18 |
# File 'lib/unbound/resolver.rb', line 16 def close @ctx.close end |
#fd ⇒ Object
20 21 22 |
# File 'lib/unbound/resolver.rb', line 20 def fd @ctx.fd end |
#process ⇒ Object
24 25 26 |
# File 'lib/unbound/resolver.rb', line 24 def process @ctx.process end |
#query(name, rrtype, rrclass, callback, private_data = nil) ⇒ Object
32 33 34 |
# File 'lib/unbound/resolver.rb', line 32 def query(name, rrtype, rrclass, callback, private_data = nil) @ctx.resolve_async(name, rrtype, rrclass, callback, private_data) end |