summaryrefslogtreecommitdiff
path: root/ares.h
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2006-05-03 06:11:44 +0000
committerDaniel Stenberg <daniel@haxx.se>2006-05-03 06:11:44 +0000
commit22e34b53e493e7f94036182ad2c6764bdc3ac5fb (patch)
tree3ae220ae061f6814386fd2650007147c9c485d9c /ares.h
parent772811b915392014886d2361bcfe58e9655edf7f (diff)
downloadc-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.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/ares.h b/ares.h
index 8e8da28..9414f9b 100644
--- a/ares.h
+++ b/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;