Re: [tcpdump-workers] forcing pcap_loop() failures

2006-10-18 Thread Guy Harris
On Oct 18, 2006, at 3:41 PM, Alexander Dupuy wrote: You really want to use select() (or poll() if your operating system doesn't support select()) instead of a CPU polling loop. You can use pcap_get_selectable_fd() to get the underlying file descriptor on a Unix system (won't work on Windo

Re: [tcpdump-workers] forcing pcap_loop() failures

2006-10-18 Thread rh
After playing around with this for a while, the solution I've used is to open two pcap_t * handles, set them non-blocking, and then call pcap_dispatch() on each of them within a while(1) loop. This sucks for (at least) two reasons: First, it's basically brain-dead and a CPU hog. Second, for

Re: [tcpdump-workers] forcing pcap_loop() failures

2006-10-18 Thread Alexander Dupuy
rh wrote: After playing around with this for a while, the solution I've used is to open two pcap_t * handles, set them non-blocking, and then call pcap_dispatch() on each of them within a while(1) loop. You really want to use select() (or poll() if your operating system doesn't support sele