Man page of PCAP_GET_REQUIRED_SELECT_TIMEOUT
Updated: 20 January 2018
Return to Main Contents
This man page documents libpcap version 1.9.0 (see also: git master branch, 1.10.1, 1.10.0, 1.9.1).Your system may have a different version installed, possibly with some local modifications. To achieve the best results, please make sure this version of this man page suits your needs. If necessary, try to look for a different version on this web site or in the man pages available in your installation.
#include <pcap/pcap.h> struct timeval *pcap_get_required_select_timeout(pcap_t *p);
The timeout that should be used in those calls must be no larger than the smallest of all timeouts returned by pcap_get_required_select_timeout() for devices from which packets will be captured.
The device for which pcap_get_selectable_fd() returned -1 must be put in non-blocking mode with pcap_setnonblock(), and an attempt must always be made to read packets from the device when the select(), poll(), epoll_wait(), or kevent() call returns.
Note that a device on which a read can be done without blocking may, on some platforms, not have any packets to read if the packet buffer timeout has expired. A call to pcap_dispatch() or pcap_next_ex() will return 0 in this case, but will not block.
pcap_get_required_select_timeout() is not available on Windows.