-
Notifications
You must be signed in to change notification settings - Fork 519
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
API: pcap_next_ex did not get all the packets that met the requirements #727
Comments
npcap version:1.79 |
How many dropped packets does |
Should I write fetch ps_drop in the timeout branch |
Since your capture loop seems not to ever exit, the right place to try it might be to, every N packets, for some value of N, call |
Well. I tried to get ps_drop every 15678 packets, and the results seemed a little hard to understand. The code looks like this:
|
I set the buffer size and the packet buffer timeout, and now I can fetch all the packets! |
Another question, if I want to use Npcap to reliably transfer 1 gigabit data to another device in the LAN in the shortest possible time, is there any good advice? |
Now, I set the buffer size to |
I packed 200,000 packets using pcap_sendqueue_queue with a sequence number field added to the packet. Then I use pcap_sendqueue_transmit to send it to another computer in the local area network. The log message printed shows that there were no abnormalities in the delivery process, and the monitoring results in Wiresshark show that the packets were sent normally.
send log:
Wireshark:
Then I use pcap_next_ex to fetch the packet from the local adapter, filter it according to the ip information it was sent, and print the sequence number information in the packet.However, after sorting through the printed information, I found that the packet sequence number was sometimes lost in the middle or at the end.
receive log:
The following is part of the sending and receiving code, is there something wrong with my code?
send:
if ((res = pcap_sendqueue_transmit(outdesc, squeue, sync)) < squeue->len){
printf("An error occurred sending the packets: %s."" Only %d bytes were sent\n", pcap_geterr(outdesc), res);
}
printf("\nTotal packets generated = %d", npacks);
listenToPcap:
The text was updated successfully, but these errors were encountered: