This is a static archive of our old Q&A Site. Please post any new questions and answers at ask.wireshark.org.

window close notification

0

Hi, I have a requirement to launch the multiple wireshark instances for multiple trace files from my application. For example, number M subscribers are monitored in number N nodes/server, it will lead to N*M wireshark windows opened. Because of these many wireshark instance memory consumption is huge.

I would like to threshold the number of wireshark instances to be opened at a time (for ex. 10 instances). So when user tries to open the 11th wireshark instance that should not be allowed. I can know the number of wireshark instance open, but how could I find that when a wireshark window is closed, my application get the notification so that it allows to open the other wireshark instance?

please help.

asked 04 Dec '12, 04:03

manojdeoli's gravatar image

manojdeoli
1556
accept rate: 0%

edited 04 Dec '12, 04:04

on a side note... I'd use dumpcap directly instead of Wireshark, because if your only intent is to capture you do not need Wireshark at all, and can spare a lot of memory. Dumpcap is the capture tool used by Wireshark to capture the actual data, and is installed in the same program directory.

(04 Dec '12, 04:19) Jasper ♦♦

my application get the notification so that it allows to open the other wireshark instance?

How do you start Wireshark within your application?

(04 Dec '12, 08:10) Kurt Knochner ♦

I have java application, and I am launching it with CLI command: wireshark <path of="" trace="" file="">.

(04 Dec '12, 20:13) manojdeoli

can you please post the java code? Just the lines that start the external application.

(05 Dec '12, 02:14) Kurt Knochner ♦

Here is code:

final String wiresharkLocation = "/usr/local/bin/"; final String cmd = wiresharkLocation+"wireshark /tmp/manoj/7898.pcap" ; System.out.println(" cmd for launchWireshark : " + cmd); try { Process process = Runtime.getRuntime().exec(cmd); } catch (Exception e) { e.printStackTrace(); System.out.println("Exception at Wireshark launch. " + e); }

(05 Dec '12, 04:19) manojdeoli

One Answer:

0

Process process = Runtime.getRuntime().exec(cmd);

Try calling the method exitValue() of the Process object.

HINT: This is more a Java question than a Wireshark question and you might get better answers in forum dedicated to Java programming.

Regards
Kurt

answered 05 Dec '12, 11:22

Kurt%20Knochner's gravatar image

Kurt Knochner ♦
24.8k1039237
accept rate: 15%

edited 05 Dec '12, 12:45