[Winpcap-users] Getting problem related to timeout pcap_next_exfunction

Athir Nuaimi athir at nuaim.com
Wed May 7 13:47:38 GMT 2008


Hi there Gianluca.  One down side of this approach is that it is Windows
specific because it of the WaitForMultipleObjects.  If we wanted code that
was cross-platform, would having one thread per adapter be the right
approach?  Also, do you think there is any difference in efficiency between
the two approaches?

 

Thanks in advance

 

From: winpcap-users-bounces at winpcap.org On Behalf Of Gianluca Varenni
Sent: Friday, May 02, 2008 7:07 PM
To: winpcap-users at winpcap.org
Subject: Re: [Winpcap-users] Getting problem related to timeout in
pcap_next_exfunction

 

I would probably set an 0 read timeout opening the adapter (pcap_open_live,
to_ms = -1), ask for the HANDLEs with pcap_gethandle() and then use
WaitForMultipleObjects to wait for the reception of packets on either
interface. From there you need to intertwine the packets coming from the two
interfaces into a single file. Actually, if you are just capturing to file,
doesn't it make more sense to capture on two different files, and then merge
them? The only caveat to this approach is that if you are working on high
speed networks, you probably want to dump the two files on two completely
separate hard drives.

 

Hope it helps

GV

 

----- Original Message ----- 

From: Ashok Gupta <mailto:agupta at devfoundry.com>  

To: winpcap-users at winpcap.org 

Sent: Tuesday, April 29, 2008 9:49 AM

Subject: [Winpcap-users] Getting problem related to timeout in
pcap_next_exfunction

 

Hi All,

 

I am making a program that takes packet from two network interface(using
networktap) and mix them in a file on timestamp basis.

 

I am getting a problem when one of interface card not capture data it wait
for timeout period and it get delay to my program.

 

I have tried with setting timeout to -1 but still getting same problem.

 

please provide a solution so I can make my program faster in this situation.

 

Thanks in advance

 

Ashok Gupta

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.winpcap.org/pipermail/winpcap-users/attachments/20080507/5cebc2dd/attachment.htm


More information about the Winpcap-users mailing list