Skip to content

Commit

Permalink
Made ICMP4 work with new versions of EventMachine
Browse files Browse the repository at this point in the history
  • Loading branch information
krakatoa committed Mar 23, 2012
1 parent 10ae372 commit e54da08
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
1 change: 0 additions & 1 deletion README
@@ -1 +0,0 @@
This is not being maintained. Fork it if you care.
10 changes: 5 additions & 5 deletions icmp4em.gemspec
@@ -1,9 +1,9 @@
Gem::Specification.new do |s|
s.name = "icmp4em"
s.version = "0.0.2"
s.date = "2009-04-3"
s.authors = ["Jake Douglas"]
s.email = "jakecdouglas@gmail.com"
s.version = "0.0.3"
s.date = "2009-04-03"
s.authors = ["Jake Douglas", 'Fernando Alonso']
s.email = "fedario@gmail.com"
s.rubyforge_project = "icmp4em"
s.has_rdoc = true
s.summary = "Asynchronous implementation of ICMP ping using EventMachine"
Expand All @@ -19,4 +19,4 @@ Gem::Specification.new do |s|
"lib/icmp4em/handler.rb",
"lib/icmp4em/icmpv4.rb"]
s.add_dependency('eventmachine')
end
end
5 changes: 3 additions & 2 deletions lib/icmp4em/icmpv4.rb
Expand Up @@ -143,7 +143,8 @@ def init_handler
saddr = Socket.pack_sockaddr_in(0, @bind_host)
self.class.recvsocket.bind(saddr)
end
self.class.handler = EM.attach self.class.recvsocket, Handler, self.class.recvsocket
self.class.handler = EM.watch self.class.recvsocket, Handler, self.class.recvsocket
self.class.handler.notify_readable = true
end

# Sets the instance id to a unique 16 bit integer so it can fit inside relevent the ICMP field.
Expand All @@ -170,4 +171,4 @@ def blocking_receive

end

end
end

0 comments on commit e54da08

Please sign in to comment.