Hi again. I've been trying to get pcap_getevent() to work with WaitForSingleObject(), but without success. Here's a code fragment which will hopefully illustrate my problem:<br><br> while(TRUE) {<br> while(clientstate < STREAMING) {
<br> if(WaitForSingleObject(pcap_getevent(skinny),0)==WAIT_OBJECT_0) {<br> if(skinny_received = pcap_next_ex(skinny, &skinny_header, &skinny_data) > 0) {<br><br>(pcap_t *skinny has been initialised with pcap_open() and then had a filter applied to it...the code worked before I added the above pcap_getevent() section.)
<br><br>For some reason WaitForSingleObject never returns WAIT_OBJECT_0 (it always returns 0x102). I'm developing with Winpcap4.0 and XP Pro SP2, Visual Studio 2005 SP1...the compiler's set to compile it as C code, not C++.
<br><br>Any advice would be much appreciated - hopefully it's just a stupid oversight on my part.<br><br>Thanks<br><br>Jonathan<br><br><br><br><br><div><span class="gmail_quote">On 07/02/07, <b class="gmail_sendername">
Gianluca Varenni</b> <<a href="mailto:gianluca.varenni@cacetech.com">gianluca.varenni@cacetech.com</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Jonathan,<br><br>you need to call pcap_getevent() and obtain a HANDLE you can wait on with<br>WaitForSingleObject or WaitForMultipleObjects().<br><br>You cannot obtain a file descriptor and use a select() on windows.<br><br>
Have a nice day<br>GV<br><br>----- Original Message -----<br>From: "Jonathan Hunt" <<a href="mailto:jgwehunt@gmail.com">jgwehunt@gmail.com</a>><br>To: <<a href="mailto:winpcap-users@winpcap.org">winpcap-users@winpcap.org
</a>><br>Sent: Wednesday, February 07, 2007 3:19 PM<br>Subject: [Winpcap-users] select()<br><br><br>> Here's a quick question:<br>><br>> Using WinPcap 4, is it possible to call select() or poll() or something
<br>> to that effect to tell me when there is data to be read on a pcap<br>> "socket"?<br>><br>> Many thanks<br>><br>> Jonathan<br>> _______________________________________________<br>> Winpcap-users mailing list
<br>> <a href="mailto:Winpcap-users@winpcap.org">Winpcap-users@winpcap.org</a><br>> <a href="https://www.winpcap.org/mailman/listinfo/winpcap-users">https://www.winpcap.org/mailman/listinfo/winpcap-users</a><br><br>
_______________________________________________<br>Winpcap-users mailing list<br><a href="mailto:Winpcap-users@winpcap.org">Winpcap-users@winpcap.org</a><br><a href="https://www.winpcap.org/mailman/listinfo/winpcap-users">
https://www.winpcap.org/mailman/listinfo/winpcap-users</a><br></blockquote></div><br>