Nick Mathewson added the ARES_OPT_SOCK_STATE_CB option that when set makes

c-ares call a callback on socket state changes. A better way than the
ares_getsock() to get full control over the socket state.
This commit is contained in:
Daniel Stenberg
2006-05-03 06:11:44 +00:00
parent 6ca627ae74
commit dd06c60ada
9 changed files with 79 additions and 11 deletions

View File

@@ -98,6 +98,24 @@ The lookups to perform for host queries.
.I lookups
should be set to a string of the characters "b" or "f", where "b"
indicates a DNS lookup and "f" indicates a lookup in the hosts file.
.TP 18
.B ARES_OPT_SOCK_STATE_CB
.B void (*\fIsock_state_cb\fP)(void *data, int s, int read, int write);
.br
.B void *\fIsock_state_cb_data\fP;
.br
A callback function to be invoked when a socket changes state.
.I s
will be passed the socket whose state has changed;
.I read
will be set to true if the socket should listen for read events, and
.I write
will be set to true if the socket should listen for write events.
The value of
.I sock_state_cb_data
will be passed as the
.I data
argument.
.PP
The
.I flags