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 | 22e34b53e493e7f94036182ad2c6764bdc3ac5fb (patch) | |
tree | 3ae220ae061f6814386fd2650007147c9c485d9c /ares.h | |
parent | 772811b915392014886d2361bcfe58e9655edf7f (diff) | |
download | c-ares-22e34b53e493e7f94036182ad2c6764bdc3ac5fb.tar.gz c-ares-22e34b53e493e7f94036182ad2c6764bdc3ac5fb.tar.bz2 c-ares-22e34b53e493e7f94036182ad2c6764bdc3ac5fb.zip |
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.h')
-rw-r--r-- | ares.h | 15 |
1 files changed, 15 insertions, 0 deletions
@@ -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; |