As I see a number of other members are doing, I am writing a packet relay program 
using Winpcap. Test system has two NICs, to relay packets across two LANs.

Program has a thread to be used for capture purposes, one for each NIC. Each thread 
performs pcap_open_live and pcap_next_ex.

Program also has a thread to be used for relay purposes, one for each NIC. Each thread 
performs pcap_open_live and pcap_sendpacket as needed.

Everything works fine, capture on one NIC, relay/send on another (discard echo back 
packets), both directions. Can ping across the program, again in both directions.

Problem occurs when relay thread intentionally delays packets via Win32 Sleep. Amount 
of sleep is programmable. When set to 3000ms, program works badly, failing to relay 
many packets, occasionally succeeding but eventually crashing with some memory 
allocation fault, deep inside Win32.

Question is this: do the two pcap_open_live on same NIC (one for capture, one for 
relay, separate threads) somehow affect one another? If the thread that is doing 
pcap_sendpacket only (occasionally delayed) interfering with the thread that is doing 
pcap_next_ex on the same NIC?

Thanks for your time.


==================================================================
 This is the WinPcap users list. It is archived at
 http://www.mail-archive.com/[EMAIL PROTECTED]/

 To unsubscribe use 
 mailto: [EMAIL PROTECTED]
==================================================================

Reply via email to