Class: Resolv::DNS::Requester
- Inherits:
-
Object
- Object
- Resolv::DNS::Requester
- Defined in:
- lib/net/dns/resolv.rb
Overview
:nodoc:
Direct Known Subclasses
Defined Under Namespace
Classes: ConnectedUDP, RequestError, Sender, TCP, UnconnectedUDP
Instance Method Summary collapse
- #close ⇒ Object
- #delete(arg) ⇒ Object
-
#initialize ⇒ Requester
constructor
A new instance of Requester.
Constructor Details
#initialize ⇒ Requester
Returns a new instance of Requester.
575 576 577 |
# File 'lib/net/dns/resolv.rb', line 575 def initialize @senders = {} end |
Instance Method Details
#close ⇒ Object
579 580 581 582 583 584 585 586 587 588 589 |
# File 'lib/net/dns/resolv.rb', line 579 def close thread, sock, @thread, @sock = @thread, @sock begin if thread thread.kill thread.join end ensure sock.close if sock end end |
#delete(arg) ⇒ Object
591 592 593 594 595 596 597 598 599 600 |
# File 'lib/net/dns/resolv.rb', line 591 def delete(arg) case arg when Sender @senders.delete_if {|k, s| s == arg } when Queue @senders.delete_if {|k, s| s.queue == arg } else raise ArgumentError.new("neither Sender or Queue: #{arg}") end end |