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