odtone::dns::resolver
// In header: </home/carlos/Projectos/odtone/inc/odtone/net/dns/resolver.hpp> class resolver { public: // construct/copy/destruct resolver(boost::asio::io_service &); ~resolver(); // public member functions void queue(std::string, enum dns_query_type, dns_callback_t); // private member functions void receive_handler(buffer< uint8 > &, size_t, const boost::system::error_code &); void send_handler(const boost::system::error_code &, std::size_t); void callback(struct query, enum dns_status); void dns_queue(void *, std::string, enum dns_query_type, std::string, dns_callback_t); void dns_cancel(const void *); boost::optional< struct query > find_cached_query(std::string, enum dns_query_type); boost::optional< struct query > find_active_query(uint16); void cleanup(); };
resolver
private member functionsvoid receive_handler(buffer< uint8 > & buff, size_t rbytes, const boost::system::error_code & error);
Handle the reception of an asynchronous message.
Parameters: |
|
void send_handler(const boost::system::error_code & ec, std::size_t bytes_transferred);
Handle of sending procedure.
Parameters: |
|
void callback(struct query query, enum dns_status status);
Find out if a given query is active.
Parameters: |
|
void dns_queue(void * ctx, std::string name, enum dns_query_type qtype, std::string dns_ip, dns_callback_t app_callback);
Queue the resolution.
Parameters: |
|
void dns_cancel(const void * context);
Cancel the query.
Parameters: |
|
boost::optional< struct query > find_cached_query(std::string name, enum dns_query_type qtype);
Find a given query in cache.
Parameters: |
|
||||
Returns: |
The query information. |
boost::optional< struct query > find_active_query(uint16 tid);
Find out if a given query is active.
Parameters: |
|
||
Returns: |
The query information if found. |
void cleanup();
Cleanup expired queries.