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

Can it support full duplex? #154

Closed
xutianyi1999 opened this issue Jan 2, 2021 · 2 comments
Closed

Can it support full duplex? #154

xutianyi1999 opened this issue Jan 2, 2021 · 2 comments

Comments

@xutianyi1999
Copy link

I don’t know the actual operation of npcap or libpcap
If it is supported, I hope the API can operate like this:

let (rx, tx) = device.open().unwrap();

thread::spawn(move || {
    ......
    tx.sendpacket(...);
});

while let Ok(packet) = rx.next(){
    ......
}
@Wojtek242
Copy link
Collaborator

I believe that it does, but not in the way you show it. pcap does not create a separate tx and rx channel (perhaps there is one within libpcap though, but that's out of scope of this crate. Rather, you create a single Capture, you pick up packets with next, and send packets with sendpacket.

I will close this issue to prevent accumulating stale issues, but do not hesitation to reopen if this does not answer your question!

@spacemeowx2
Copy link

Same problem here.

Rather, you create a single Capture, you pick up packets with next, and send packets with sendpacket.

The problem is the packet can not be sent at anytime. It must wait the next return and send the packet.

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