We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexProgramming Questions & HelpProcessing Implementations › Carnivore & reflective classes in ruby-processing
Page Index Toggle Pages: 1
Carnivore & reflective classes in ruby-processing (Read 1511 times)
Carnivore & reflective classes in ruby-processing
Apr 18th, 2009, 5:08pm
 
I'm trying to use Carnivore [1] with ruby-processing with [2] a few hiccups I managed to get it running, but there appears to be a fundamental problem.

As jashkenas kindly laid out ([3]here) there are some issues with JRuby where reflective things don't play nice, it looks like carnivore uses these exact thingies to call a function 'packetEvent' every time a packet is sniffed out, and as such the core (only) functionality of Carnivore is unusable without some kind of patch.

I'm not a Java programmer (can you tell) so I have no idea about how to write a 'thin Java class' to sort out this issue. Does anyone out there have any advice

Cheers!

Links (yay for new posters)
[1]: http:/--/r-s-g.org/carnivore/
[2]: http:/--/r-s-g.org/carnivore/forum/num_1240097151.html
[3]: http:/--/wiki.github.com/jashkenas/ruby-processing/java-and-ruby-libraries
Re: Carnivore & reflective classes in ruby-processing
Reply #1 - Apr 19th, 2009, 10:00am
 
Hiya JP.

Looks like you understand the guts of the issue quite well. I've updated that wiki page with a fuller explanation of how to work around it, but I'll be much relieved when the JRuby guys start to support Java reflection on Ruby objects.

I've got a working Ruby-Processing w/Carnivore sketch. If you want to compile the interface yourself, then just take a peek at the source here:

http://gist.github.com/98128

Otherwise, you can download the full sketch, suitable for running with "rp5 carnivorous.rb", here:

http://s3.amazonaws.com/jashkenas/misc/carnivorous.zip

Hope that helps, and good luck with your project.
Re: Carnivore & reflective classes in ruby-processing
Reply #2 - Apr 20th, 2009, 6:37pm
 
You are a hero!
I've got the basics of the idea I was trying to sketch out sorted, thought you might like a play with what you helped create!

http:/--/gist.github.com/98878

The duct tape has probably already fallen off its inelegant code, but it works (for now) and when my finals get closer I'll no doubt come back and play with it, procrastination style :P

Thanks for your help!
Page Index Toggle Pages: 1