Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PacketStream does not set pcap timeout #30

Open
andrey-shigantsov opened this issue Oct 20, 2021 · 2 comments
Open

PacketStream does not set pcap timeout #30

andrey-shigantsov opened this issue Oct 20, 2021 · 2 comments

Comments

@andrey-shigantsov
Copy link

Hi, thanks for your work!

I started using your library and noticed that the capture cycle returns packets too slowly, although the default timeout is 100ms in the config.
https://github.com/protectwise/pcap-async/blob/master/src/config.rs#L94

I looked at the sources and noticed that the parameter setting is not happening.
https://github.com/protectwise/pcap-async/blob/master/src/stream.rs#L32-L34

I set this parameter manually and the program worked as expected.

pcap_handle.set_timeout(pcap_config.buffer_for())?;
let mut provider = pcap::PacketStream::new(pcap_config, Arc::clone(&pcap_handle))?.boxed();
@dbcfd
Copy link
Collaborator

dbcfd commented Nov 9, 2021

Given that no one has responded, my best suggestion is to fork this crate. Not sure if anyone still has access to push changes to this crate.

@Stargateur
Copy link

Just come randomly but https://github.com/rust-pcap/pcap/blob/main/examples/streamlisten.rs handle async so you could give it a try.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants