On Wed, Nov 06, 2002 at 10:03:06AM +0200, Petri Helenius wrote: > > The specific problem with bpf is that one might have a half-full buffer > of captured data when the select timeout hits. In that case the select > returns with no FDs ready while I think it really should return with > the bpf fd. (and if you look at the code on sys/net/bpf.c, there is > timeout handling towards that goal) but I?ve yet to figure out where it goes > wrong. > > IMO, at timeout the code should check if bd_slen > 0 and if yes, > do ROTATE_BUFFERS and bpf_wakeup()
The bpf timeout has nothing to do with the select timeout. Two separate facilities. > The functionality I?m looking for is to get all the packets accumulated, say > in 1 second in single read regardless of if I got a buffer?s full of data. Then do a select with no FDs just to get a periodic wakeup. Then at wakeup do the bpf read, having set nonblocking and immediate mode so you don't get stuck in the read. -- Barney Wolff http://www.databus.com/bwresume.pdf I'm available by contract or FT, in the NYC metro area or via the 'Net. To Unsubscribe: send mail to [EMAIL PROTECTED] with "unsubscribe freebsd-net" in the body of the message
