mscdex / cap

A cross-platform binding for performing packet capturing with node.js
MIT License
361 stars 45 forks source link

Return read packets immediately on Windows 10 #89

Closed tonetechnician closed 5 years ago

tonetechnician commented 5 years ago

Hey there,

I'm using this package on both Windows 10 and MacOSx Mojave.

On Mojave, the module returns any received packets immediately, whilst on Windows I see there is a buffering of sorts taking place. This results in any delays in my application which I'm not wanting, I'd like to have each packet reflected immediately.

I've looked at the winpcap Packet.h file which includes the `#define IMMEDIATE 1 flag. I believe this allows for the packets to be given immediately. Is there anyway something similar can be included in this module's Packet32.h. Adding the definition into there and rebuilding doesn't seem to work.

Any help would be greatly appreciated!

mscdex commented 5 years ago

Are you using setMinBytes(0)?

tonetechnician commented 5 years ago

Thanks so much for the quick response. I forgot to add this in. It fixed my problem :)