mfontanini / libtins

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

set_immediate_mode does not prevent buffering on windows npcap #463

Open moffel opened 2 years ago

moffel commented 2 years ago

The FAQ states that set_immediate_mode would be sufficient to disable buffering for latency sensitive applications. On windows however the latency after setting set_immediate_mode to true is still around 1 second.

To fix this the user has to call

pcap_setmintocopy(sniffer.get_pcap_handle(), 0);

This works and should probably be part of tins set_immediate_mode or there should be a dedicated setmintocopy method on sniffer plus FAQ udpate.