[tcpdump-workers] libpcap and select problem

2004-10-25 Thread Ying Li
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.


Re: [tcpdump-workers] libpcap and select problem

2004-10-25 Thread Guy Harris
On Oct 25, 2004, at 1:27 PM, Ying Li wrote:
Sometimes select() times out way too
fast, like 0.0001 seconds while my timevar is set to
0.001 sec.
Times out in the sense that retval is 0?
On what OS are you doing this?
-
This is the tcpdump-workers list.
Visit https://lists.sandelman.ca/ to unsubscribe.