On Tue, 5 Jun 2001, Guy Harris wrote: ~ > > On Mon, 4 Jun 2001, Guy Harris wrote: > > For me, timeouts work quite perfect, using select(). > > "Even" :) on BSD. You just need to set BIOCIMMEDIATE > > ioctl on the bpf device. > > BIOCIMMEDIATE causes the timeout not to do anything, so that you don't > get any "batching" of packets: > > BIOCIMMEDIATE (u_int) Enable or disable ``immediate mode'', based on the > truth value of the argument. When immediate mode is en- > abled, reads return immediately upon packet reception. > Otherwise, a read will block until either the kernel > buffer becomes full or a timeout occurs. This is useful > for programs like rarpd(8) which must respond to messages > in real time. The default for a new file is off. > > > I added this by myself on a higher-level, since pcap seems > > to miss it in the BSD code. > > The lack of batching is *why* libpcap doesn't turn it on - the reason > for batching packets is to reduce the number of reads done by increasing > the number of packets you get per read. > For me select() on BSD only worked when using BIOCIMMEDIATE. Sebastian --- "Please stop the earth. Let me off." - 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
