summaryrefslogtreecommitdiff
path: root/ares_process.3
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2007-05-30 12:58:47 +0000
committerDaniel Stenberg <daniel@haxx.se>2007-05-30 12:58:47 +0000
commit8c35c65fc7c746d5803a48151e82e0435c20a84c (patch)
tree1292033b628847625ec96fbf2f431cc1c2c8895e /ares_process.3
parent557aad7b0271e96ab76a9eaf59dab3f52289ba0e (diff)
downloadc-ares-8c35c65fc7c746d5803a48151e82e0435c20a84c.tar.gz
c-ares-8c35c65fc7c746d5803a48151e82e0435c20a84c.tar.bz2
c-ares-8c35c65fc7c746d5803a48151e82e0435c20a84c.zip
added ares_process_fd() to allow applications to ask for processing on
specific sockets and thus avoiding select() and associated functions/macros. This function will be used by upcoming libcurl releases for this very reason. It also made me export the ares_socket_t type in the public ares.h header file, since ares_process_fd() uses that type for two of the arguments.
Diffstat (limited to 'ares_process.3')
-rw-r--r--ares_process.321
1 files changed, 13 insertions, 8 deletions
diff --git a/ares_process.3 b/ares_process.3
index 50216e1..c9cd547 100644
--- a/ares_process.3
+++ b/ares_process.3
@@ -24,16 +24,16 @@ ares_process \- Process events for name resolution
.B void ares_process(ares_channel \fIchannel\fP, fd_set *\fIread_fds\fP,
.B fd_set *\fIwrite_fds\fP)
.fi
+.PP
+.B void ares_process_fd(ares_channel \fIchannel\fP,
+.B ares_socket_t \fIread_fd\fP,
+.B ares_socket_t \fIwrite_fd\fP)
+.fi
.SH DESCRIPTION
-The
-.B ares_process
-function handles input/output events and timeouts associated with
-queries pending on the name service channel identified by
+The \fBares_process(3)\fP function handles input/output events and timeouts
+associated with queries pending on the name service channel identified by
.IR channel .
-The file descriptor sets pointed to by
-.I read_fds
-and
-.I write_fds
+The file descriptor sets pointed to by \fIread_fds\fP and \fIwrite_fds\fP
should have file descriptors set in them according to whether the file
descriptors specified by \fIares_fds(3)\fP are ready for reading and writing.
(The easiest way to determine this information is to invoke
@@ -44,6 +44,11 @@ The
.B ares_process
function will invoke callbacks for pending queries if they complete
successfully or fail.
+
+\fBares_process_fd(3)\fP works the same way but acts and operates only on the
+specific file descriptors (sockets) you pass in to the function. Use
+ARES_SOCKET_BAD for "no action". This function is of course provided to allow
+users of c-ares to void select() in their applications and within c-ares.
.SS EXAMPLE
The following code fragment waits for all pending queries on a channel
to complete: