Name

ares_process_fd, ares_process - Process events for name resolution

Synopsis

#include <ares.h>
 
void ares_process_fd(ares_channel_t *channel,
                     ares_socket_t read_fd,
                     ares_socket_t write_fd)
 
void ares_process(ares_channel_t *channel,
                  fd_set *read_fds,
                  fd_set *write_fds)
 

Description

The ares_process_fd function handles input/output events and timeouts associated with queries pending on the name service channel identified by channel. The file descriptor passed in read_fd and write_fd indicate if the file descriptor has been notified of a read event or write event, respectively. If a notification has not occurred, use ARES_SOCKET_BAD.

This function is typically used with the ARES_OPT_SOCK_STATE_CB option.

ares_timeout should be used to retrieve the desired timeout, and when the timeout expires, the integrator must call ares_process_fd with both sockets set to ARES_SOCKET_BAD. There is no need to do this if events are also delivered for any file descriptors as timeout processing will automatically be handled by any call to ares_process_fd.

The ares_process function works in the same manner, except it works on fd_sets as is used by select(3) and retrieved by ares_fds. This method is deprecated and should not be used in modern applications due to known limitations to the select(3) implementation.

See also

ares_fds(3), ares_timeout(3), ares_init_options(3) with ARES_OPT_EVENT_THREAD or ARES_OPT_SOCK_STATE_CB

This HTML page was made with roffit.