My suggestion is to use pcap_next_ex, and a timeout (in pcap_open_live) of 1 second or less. You are sure that pcap_next_ex will return at most after the timeout you used in pcap_open_live (on Windows), and after that you just need to see if the certain amount of time is elapsed or not.
Have a nice day GV ----- Original Message ----- From: Emre To: [email protected] Sent: Thursday, November 12, 2009 5:30 AM Subject: [Winpcap-users] Capturing packets for a certain time Hi, i want to capture packets from an interface for a certain time. There is example with pcap_loop function which captures packets with cnt parameter. This function captures cnt number of packets from interface . But i want to do is capture packets from an interface for ten seconds. There is a pcap_breakloop function for breaking the pcap_loop but i don't know how to use it for my need. Please help. ------------------------------------------------------------------------------ _______________________________________________ Winpcap-users mailing list [email protected] https://www.winpcap.org/mailman/listinfo/winpcap-users
_______________________________________________ Winpcap-users mailing list [email protected] https://www.winpcap.org/mailman/listinfo/winpcap-users
