tcpdump mailing list archives

libpcap and select problem


From: Ying Li <hellbunni () yahoo com>
Date: Mon, 25 Oct 2004 13:27:48 -0700 (PDT)

Hi,

    I'm trying to write a program that simulates a RDP
(RUDP) protocol with a timeout on the host.  Right now
i have it as

-pcap_setnonblock(...)
-reset timevar
-retval = select(...., &timevar); or pselect(...)
-if(retval)
----pcap_dispatch(...) or pcap_next_ex(...)
-else
----timeout++

I've tried pselect,select, pcap_next_ex,
pcap_dispatch, nonblock, block.  But none of them seem
to work right.  Sometimes select() times out way too
fast, like 0.0001 seconds while my timevar is set to
0.001 sec.  I'ved tried making it always timeout and
used gettimeofday() to check the time it waited, and
it would be a variable(with big differences).  Can
anyone point me in the right direction?  Thanks!!

-Ying Li



__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 
-
This is the tcpdump-workers list.
Visit https://lists.sandelman.ca/ to unsubscribe.


Current thread: