Hi,

        I am using Jpcap written by Keita Fujii from the web site http://www.goto.info.waseda.ac.jp/~fujii/jpcap/. I wrote a multithreaded app in Java, where one thread called loopPacket, which calls pcap_loop and waits forever, the other thread sleeps for sometime and calls pcap_close. This would cause the JVM to crash. I did looked at the wpcap code and added a check in pcap_loop do-while statement to check if p->adaptor is NULL. Because pcap_close make the adaptor NULL. I also added the same check in the while loop inside pcap_read. This has solved the problem and I never get this problem anymore.

        I would like to hear your comments on this and whether I am doing the right thing?

Thanks,
Abhijeet 

Reply via email to