[Winpcap-users] Getting problem related to
timeoutpcap_next_exfunction
Gianluca Varenni
gianluca.varenni at cacetech.com
Fri May 9 00:05:12 GMT 2008
Using two threads, one per adapter, is definitely cross-platform. I think that the two approaches you were talking about were using a single thread for both the adapters and dumping on a single file vs. 2threads and 2 files. The latter is easier to implement, just be careful at dumping two files at the same time on the same disk. If you are dumping at high speed, dumping two files at the same time can kill the HD (*can*. It depends on the hard drive, if you are using RAID or not, and so on).
Hope it helps
GV
----- Original Message -----
From: Athir Nuaimi
To: winpcap-users at winpcap.org
Sent: Wednesday, May 07, 2008 6:47 AM
Subject: RE: [Winpcap-users] Getting problem related to timeoutpcap_next_exfunction
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
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
------------------------------------------------------------------------------
_______________________________________________
Winpcap-users mailing list
Winpcap-users at winpcap.org
https://www.winpcap.org/mailman/listinfo/winpcap-users
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.winpcap.org/pipermail/winpcap-users/attachments/20080509/e34e1b97/attachment.htm
More information about the Winpcap-users
mailing list