2 .\" Copyright 1998 by the Massachusetts Institute of Technology.
4 .\" Permission to use, copy, modify, and distribute this
5 .\" software and its documentation for any purpose and without
6 .\" fee is hereby granted, provided that the above copyright
7 .\" notice appear in all copies and that both that copyright
8 .\" notice and this permission notice appear in supporting
9 .\" documentation, and that the name of M.I.T. not be used in
10 .\" advertising or publicity pertaining to distribution of the
11 .\" software without specific, written prior permission.
12 .\" M.I.T. makes no representations about the suitability of
13 .\" this software for any purpose. It is provided "as is"
14 .\" without express or implied warranty.
16 .TH ARES_PROCESS 3 "25 July 1998"
18 ares_process \- Process events for name resolution
23 .B void ares_process(ares_channel \fIchannel\fP, fd_set *\fIread_fds\fP,
24 .B fd_set *\fIwrite_fds\fP)
27 .B void ares_process_fd(ares_channel \fIchannel\fP,
28 .B ares_socket_t \fIread_fd\fP,
29 .B ares_socket_t \fIwrite_fd\fP)
32 The \fBares_process(3)\fP function handles input/output events and timeouts
33 associated with queries pending on the name service channel identified by
35 The file descriptor sets pointed to by \fIread_fds\fP and \fIwrite_fds\fP
36 should have file descriptors set in them according to whether the file
37 descriptors specified by \fIares_fds(3)\fP are ready for reading and writing.
38 (The easiest way to determine this information is to invoke
40 with a timeout no greater than the timeout given by \fIares_timeout(3)\fP ).
44 function will invoke callbacks for pending queries if they complete
47 \fBares_process_fd(3)\fP works the same way but acts and operates only on the
48 specific file descriptors (sockets) you pass in to the function. Use
49 ARES_SOCKET_BAD for "no action". This function is of course provided to allow
50 users of c-ares to void select() in their applications and within c-ares.
52 The following code fragment waits for all pending queries on a channel
58 fd_set readers, writers;
59 struct timeval tv, *tvp;
65 nfds = ares_fds(channel, &readers, &writers);
68 tvp = ares_timeout(channel, NULL, &tv);
69 count = select(nfds, &readers, &writers, NULL, tvp);
70 ares_process(channel, &readers, &writers);
78 Greg Hudson, MIT Information Systems
80 Copyright 1998 by the Massachusetts Institute of Technology.