----- Original Message -----
From: "J. William Campbell" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, June 17, 2004 1:24 AM
Subject: [WinPcap-users] Question/problem regarding pcap_getevent
> I am using Windows XP and winpcap_3_1_beta_3 to capture packets of a
> particular network protocol. The capture loop appears below:
> FD_VERSANET_HANDLE = pcap_getevent(FD_VERSANET);
>
> do
> {
> // WaitForSingleObject(FD_VERSANET_HANDLE, INFINITE);
> res = pcap_next_ex( FD_VERSANET, &header, &vnLaninBuf);
> if (res == 0)
> continue; /* timeout */
> printf("got one %d\n", header->caplen);
>
>
> } while (TRUE);
>
> If the WaitForSingleObject is commented out, it works fine, and the
> printf executes. If the Wait is compiled in, the event is never signaled
> and the
> WaitFor does not return. Am I using the event incorrectly, or??? Any
> help would be appreciated, or if it is perhaps a bug I would be glad to
> help
> find it.
Hi. I think the "problem" is that such event is signalled by the kernel only
when a certain amount of data is present in the buffer (the so called
"mintocopy"). Such event is NOT signalled when the timeout you set with
pcap_open (or pcap_open_live) is elapsed; such timeout is passed to the
Packet Api, and PacketReceivePacket actually performs a timed wait on such
event (WaitForSingleObject(pReadEvent, timeout)).
Hope this helps.
Have a nice day
GV
>
> Bill Campbell
>
>
>
>
> ==================================================================
> This is the WinPcap users list. It is archived at
> http://www.mail-archive.com/[EMAIL PROTECTED]/
>
> To unsubscribe use
> mailto: [EMAIL PROTECTED]
> ==================================================================
>
==================================================================
This is the WinPcap users list. It is archived at
http://www.mail-archive.com/[EMAIL PROTECTED]/
To unsubscribe use
mailto: [EMAIL PROTECTED]
==================================================================