1ARES_GETSOCK(3) Library Functions Manual ARES_GETSOCK(3)
2
3
4
6 ares_getsock - get socket descriptors to wait on
7
9 #include <ares.h>
10
11 int ares_getsock(ares_channel channel, ares_socket_t *socks,
12 int numsocks);
13
15 The ares_getsock function retrieves the set of socket descriptors which
16 the calling application should wait on for reading and/or writing for
17 the processing of name service queries pending on the name service
18 channel identified by channel. Socket descriptors will be set in the
19 socket descriptor array pointed to by socks. numsocks is the size of
20 the given array in number of ints.
21
22 This function can only return information about up to 16 sockets. If
23 more are in use (however unlikely that is), they are simply not re‐
24 ported back.
25
27 ares_getsock returns a bitmask for what actions to wait for on the dif‐
28 ferent sockets. The ares.h header file provides these convenience
29 macros to extract the information appropriately:
30
31 #define ARES_GETSOCK_MAXNUM 16 /* ares_getsock() can return info about
32 this many sockets */
33 #define ARES_GETSOCK_READABLE(bits,num) (bits & (1<< (num)))
34 #define ARES_GETSOCK_WRITABLE(bits,num) (bits & (1 << ((num) + ARES_GETSOCK_MAXNUM)))
35
37 This function was added in c-ares 1.3.1
38
40 ares_timeout(3), ares_fds(3), ares_process(3)
41
42
43
44 11 March 2010 ARES_GETSOCK(3)