Class: Arpoon::Interface::Handler
- Inherits:
-
EM::Connection
- Object
- EM::Connection
- Arpoon::Interface::Handler
- Defined in:
- lib/arpoon/interface.rb
Instance Method Summary collapse
-
#initialize(interface) ⇒ Handler
constructor
A new instance of Handler.
- #notify_readable ⇒ Object
Constructor Details
#initialize(interface) ⇒ Handler
Returns a new instance of Handler.
19 20 21 |
# File 'lib/arpoon/interface.rb', line 19 def initialize (interface) @interface = interface end |
Instance Method Details
#notify_readable ⇒ Object
23 24 25 26 27 28 29 30 31 32 33 |
# File 'lib/arpoon/interface.rb', line 23 def notify_readable (*) @interface.capture.dispatch {|_, packet| begin next unless packet = Packet.unpack(packet.body, @interface) rescue nil @interface.fire :packet, packet rescue Exception => e Arpoon.log e, "interface: #{@interface.name}" end } end |