Crate c_ares [−] [src]
A safe wrapper for the c-ares
library.
Usage is as follows:
Create a
Channel
.Make queries on the
Channel
. Queries all take callbacks, which will be called when the query completes.Have
c-ares
tell you what file descriptors to listen on for read and / or write events. You can do this either by providing a callback, which is called whenever the set of interesting file descriptors changes, or by querying theChannel
directly withget_sock()
.Do as
c-ares
asks. That is, listen for the events that it requests, on the file descriptors that it cares about.When a file descriptor becomes readable or writable, call
process_fd()
on theChannel
to tellc-ares
what has happened.If you have queries pending and don't see events happening, you still need to call
process_fd()
at some point anyway - to givec-ares
an opportunity to process any requests that have timed out.
Complete examples showing how to use the library can be found here.
Modules
flags | |
ni_flags |
Structs
AAAAResults |
The result of a successful AAAA lookup. |
AResults |
The result of a successful A lookup. |
CNameResults |
The result of a successful CNAME lookup. |
Channel |
A channel for name service lookups. |
GetSock |
Information about the set of sockets that |
HostAddressResult |
An address, as retrieved from a host lookup. |
HostAliasResult |
An alias, as retrieved from a host lookup. |
HostResults |
The result of a successful host lookup. |
MXResult |
The contents of a single MX record. |
MXResults |
The result of a successful MX lookup. |
NAPTRResult |
The contents of a single NAPTR record. |
NAPTRResults |
The result of a successful NAPTR lookup. |
NSResults |
The result of a successful NS lookup. |
NameInfoResult |
The result of a successful name-info lookup. |
Options |
Used to configure the behaviour of the name resolver. |
PTRResults |
The result of a successful PTR lookup. |
SOAResult |
The result of a successful SOA lookup. |
SRVResult |
The contents of a single SRV record. |
SRVResults |
The result of a successful SRV lookup. |
TXTResult |
The contents of a single TXT record. |
TXTResults |
The result of a successful TXT lookup. |
Enums
AddressFamily |
Address families. |
AresError |
Error codes that the library might return. |
IpAddr |
An IP address, either an IPv4 or an IPv6 address. |
Constants
INVALID_FD |
An invalid file descriptor. Use this to represent 'no action' when calling
|