<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.2900.5726" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT size=2>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.</FONT></DIV>
<DIV><FONT size=2></FONT>&nbsp;</DIV>
<DIV><FONT size=2>Have a nice day</FONT></DIV>
<DIV><FONT size=2>GV</FONT></DIV>
<BLOCKQUOTE 
style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
  <DIV style="FONT: 10pt arial">----- Original Message ----- </DIV>
  <DIV 
  style="BACKGROUND: #e4e4e4; FONT: 10pt arial; font-color: black"><B>From:</B> 
  <A title=qxtrml@gmail.com href="mailto:qxtrml@gmail.com">Emre</A> </DIV>
  <DIV style="FONT: 10pt arial"><B>To:</B> <A title=winpcap-users@winpcap.org 
  href="mailto:winpcap-users@winpcap.org">winpcap-users@winpcap.org</A> </DIV>
  <DIV style="FONT: 10pt arial"><B>Sent:</B> Thursday, November 12, 2009 5:30 
  AM</DIV>
  <DIV style="FONT: 10pt arial"><B>Subject:</B> [Winpcap-users] Capturing 
  packets for a certain time</DIV>
  <DIV><BR></DIV>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. 
  <P>
  <HR>

  <P></P>_______________________________________________<BR>Winpcap-users 
  mailing 
  list<BR>Winpcap-users@winpcap.org<BR>https://www.winpcap.org/mailman/listinfo/winpcap-users<BR></BLOCKQUOTE></BODY></HTML>