tcpdump mailing list archives

Re: libpcap and select problem


From: Ying Li <hellbunni () yahoo com>
Date: Tue, 26 Oct 2004 06:52:58 -0700 (PDT)

time out as in retval = 0
OS = redhat 9
I used ethereal to monitor traffic.

my server is suppose to send something to the client
using raw socket, use select/pselect with pcap to wait
for reply or resend last packet if timeout (retval
=0).
I reset(like putting tv_sec=0;tv_usec=1500; before
select) the value of timeval before call to
select/pselect each time.

Most of the time it works fine, but there are some
cases where my server sends 2 packets within 0.0001
seconds of each other, which shouldn't happen.  This
is when I set timeval.sec =0 and timeval.usec = 1500

The other weird thing is that the overall transfer
time of a bulk of data is 50%+ faster with these
timeout problems, as opposed to setting a longer
timeout or taking out the select()(i.e. server sends,
waits,  sends, assuming no packet lost) 
  

--- Guy Harris <guy () alum mit edu> wrote:


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.




                
__________________________________
Do you Yahoo!?
Yahoo! Mail Address AutoComplete - You start. We finish.
http://promotions.yahoo.com/new_mail 
-
This is the tcpdump-workers list.
Visit https://lists.sandelman.ca/ to unsubscribe.


Current thread: