tcpdump mailing list archives
Re: Exception conditions on pcap descriptors?
From: Sam Roberts <vieuxtech () gmail com>
Date: Fri, 30 Dec 2011 12:41:34 -0800
On Thu, Dec 29, 2011 at 3:45 PM, Fernando Gont <fernando () gont com ar> wrote:
I'm doing I/O multiplexing by obtaining the underlying file descriptor for the pcap_t "socket", with pcap_fileno(). I was wondering whether I should check for exceptions on such descriptor (in addition to readability and writeability), and whether such exceptions could possibly occur (and if so, what the possible causes of such exceptions could be).
Socket exception checked with select aren't exceptions in the sense of error, they are what is more commonly called out-of-band data. Its a perpetual source of confusion. You should only have to check for readability, if there is an error pending on the socket it will be readable, and read/recv will return the error. Cheers, Sam - This is the tcpdump-workers list. Visit https://cod.sandelman.ca/ to unsubscribe.
Current thread:
- Exception conditions on pcap descriptors? Fernando Gont (Dec 29)
- Re: Exception conditions on pcap descriptors? Sam Roberts (Dec 30)