mfontanini / libtins

High-level, multiplatform C++ network packet sniffing and crafting library.
http://libtins.github.io/
BSD 2-Clause "Simplified" License
1.91k stars 376 forks source link

not stopping "sniff_loop" with "stop_sniff" #255

Open charada opened 6 years ago

charada commented 6 years ago

Hi

We are using libtins3.5 and recently changed to pcap 1.8.1 (we were using old version 1.5.3). Since we've done this change, we cannot stop "sniff_loop" by using "stop_sniff". Is there any issue regarding this?

Thanks in advance,

Best regards, Marta Moretón

mfontanini commented 6 years ago

This is duplicate of #226. You can use pcap_dispatch (see issue) and then wait for a timeout.

charada commented 6 years ago

I saw it... but we're not using timeouts, we use "stop_sniff". How do we wait for a timeout then?

thanks!

charada commented 6 years ago

I changed to pcap_dispatch inside the method "next_packet", but it keeps locked at the latter method