Module: ICMP4EM::Handler

Includes:
Common
Defined in:
lib/icmp4em/handler.rb

Constant Summary

Constants included from Common

Common::ICMP_ECHO, Common::ICMP_ECHOREPLY, Common::ICMP_SUBCODE

Instance Method Summary collapse

Instance Method Details

#initialize(socket) ⇒ Object



7
8
9
# File 'lib/icmp4em/handler.rb', line 7

def initialize(socket)
  @socket = socket
end

#notify_readableObject



11
12
13
# File 'lib/icmp4em/handler.rb', line 11

def notify_readable
  receive(@socket)
end

#unbindObject



15
16
17
# File 'lib/icmp4em/handler.rb', line 15

def unbind
  @socket.close if @socket
end