3

What's the best way to use libpcap with Scala? I need to capture from live network devices, so it will most likely need a native binding.

I've found a couple like JPcap and JNetPcap but nothing particularly for Scala...

Any recommendations?

PeterM
  • 2,534
  • 6
  • 31
  • 38

1 Answers1

4

Since the libraries run on JVM already there is no need for an additional wrapper for Scala. Just pick the best library and pimp it to your needs.

JNetPcap seems like the most updated one here.

Allen Luce
  • 7,859
  • 3
  • 40
  • 53
thoredge
  • 12,237
  • 1
  • 40
  • 55
  • 1
    As I'm new to Scala I was hoping to find a wrapper that wouldn't require me to figure out how to get the Java libraries to inter-operate. I suppose it's not difficult if you know Scala, but being new to it, it's an extra challenge I could do without right now :) – PeterM Jan 12 '12 at 03:52
  • 1
    Well it's quite simple once you've imported scala.collection.JavaConverters._ to convert collections .asJava and .asScala. If I were to write a marginal library, such as these are, I believe I would still consider using java to write them. Both because it is so simple to use in scala, but also to have a larger user and contributor base. – thoredge Jan 12 '12 at 07:43