diff options
author | Daniel Stenberg <daniel@haxx.se> | 2006-05-03 06:11:44 +0000 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2006-05-03 06:11:44 +0000 |
commit | dd06c60ada039faafd937a136e3dc7ff9c41159a (patch) | |
tree | 5e5337faa1571a343b4c643da651ca817afc7802 /ares/ares.h | |
parent | 6ca627ae742816cfca67d7e2ad3b59c269e5651d (diff) |
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.
Diffstat (limited to 'ares/ares.h')
-rw-r--r-- | ares/ares.h | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/ares/ares.h b/ares/ares.h index 8e8da2847..9414f9b78 100644 --- a/ares/ares.h +++ b/ares/ares.h @@ -93,6 +93,7 @@ extern "C" { #define ARES_OPT_SERVERS (1 << 6) #define ARES_OPT_DOMAINS (1 << 7) #define ARES_OPT_LOOKUPS (1 << 8) +#define ARES_OPT_SOCK_STATE_CB (1 << 9) /* Nameinfo flag values */ #define ARES_NI_NOFQDN (1 << 0) @@ -135,6 +136,18 @@ extern "C" { #define ARES_GETSOCK_WRITABLE(bits,num) (bits & (1 << ((num) + \ ARES_GETSOCK_MAXNUM))) +#ifdef WIN32 +typedef void (*ares_sock_state_cb)(void *data, + SOCKET socket, + int readable, + int writable); +#else +typedef void (*ares_sock_state_cb)(void *data, + int socket, + int readable, + int writable); +#endif + struct ares_options { int flags; int timeout; @@ -147,6 +160,8 @@ struct ares_options { char **domains; int ndomains; char *lookups; + ares_sock_state_cb sock_state_cb; + void *sock_state_cb_data; }; struct hostent; |