nmap / npcap

Nmap Project's Windows packet capture and transmission library
https://npcap.com
Other
2.92k stars 508 forks source link

NpcapDevice SharpPCAP exception SOMETIMES #121

Open blakeyjason opened 4 years ago

blakeyjason commented 4 years ago

Hi, first off, thanks for all the hard work - I can't count how many WireShark/npcap installs I've done over the last X years. It's appreciated.

Right now I'm working on a C# .net core app that will concurrently playback multiples PCAPs using packet queues. I'm using the latest nmap release with the latest master of SharpPCAP. I've got each playback in a separate thread (using the Task/async framework in C#).

Sometimes, it works fine. I have had instances where my tool was able to run 10 concurrent playbacks. But a lot of the time, I get an exception, right at start of playbacks. Please see the attached screenshot. It's weird that it's so intermittent.

Please let me know if you need any more data. I'll post up my read/playback method later today, if you think that'll help.

Thanks, jason

Error
blakeyjason commented 4 years ago

After more trial and error, I find that If I wrap the get interfaces in a loop of 10 tries, I'll eventually get the complete interface list. The same goes for getting the device.... Wrap it up, check for null.

I'm sure it's windows...

Thanks, jason