Hi, all,
I have a question with pcap_dispatch(), where to set it's timeout?
I have set the timeout value in pcap_open_live() as
pcap_open_live(device, snaplen, promise, 100, errbuf)
// 100 ms of time out for packet capture?
In my main program:
while(1) {
pcap_dispatch(pd, 1, call-back-function, NULL);
"Other statements"
}
But it seems if there is no packet the pcap_dispatch can capture, it will
block although I set the timeout in pcap_open_live(), the "Other
Statements" will never have a chance to be executed if there is no packet
for capture.
Environment: RH Linux 6.2 (2.2.14), I capture packet on ipsec0 (a
interface created by FreeS/WAN.)
Thanks in advance!
============================================================
Wei Qu
Graduate Student, Research Assistant
Faculty of Computer Science, Dalhousie University
E_Mail: [EMAIL PROTECTED]
Home : http://www.cs.dal.ca/~wei/
************************************************************
May you have warm words on the cold evening, a full moon on
the dark night, and a smooth road all the way to your door.
============================================================
-
This is the TCPDUMP workers list. It is archived at
http://www.tcpdump.org/lists/workers/index.html
To unsubscribe use mailto:[EMAIL PROTECTED]?body=unsubscribe