11 #ifndef ASIO_DETAIL_RESOLVER_SERVICE_HPP 12 #define ASIO_DETAIL_RESOLVER_SERVICE_HPP 14 #if defined(_MSC_VER) && (_MSC_VER >= 1200) 16 #endif // defined(_MSC_VER) && (_MSC_VER >= 1200) 20 #if !defined(ASIO_WINDOWS_RUNTIME) 34 template <
typename Protocol>
58 iterator_type
resolve(implementation_type&,
const query_type& query,
72 template <
typename Handler>
74 const query_type& query, Handler& handler)
78 typename op::ptr p = { asio::detail::addressof(handler),
80 sizeof(op), handler), 0 };
90 iterator_type
resolve(implementation_type&,
94 char service_name[NI_MAXSERV];
96 host_name, NI_MAXHOST, service_name, NI_MAXSERV,
97 endpoint.protocol().type(), ec);
100 endpoint, host_name, service_name);
104 template <
typename Handler>
106 const endpoint_type& endpoint, Handler& handler)
110 typename op::ptr p = { asio::detail::addressof(handler),
112 sizeof(op), handler), 0 };
127 #endif // !defined(ASIO_WINDOWS_RUNTIME) 129 #endif // ASIO_DETAIL_RESOLVER_SERVICE_HPP static basic_resolver_iterator create(asio::detail::addrinfo_type *address_info, const std::string &host_name, const std::string &service_name)
Create an iterator from an addrinfo list returned by getaddrinfo.
const asio::detail::addrinfo_type & hints() const
Get the hints associated with the query.
shared_ptr< void > shared_cancel_token_type
Provides core I/O functionality.
Protocol::endpoint endpoint_type
void async_resolve(implementation_type &impl, const query_type &query, Handler &handler)
asio::ip::basic_resolver_query< Protocol > query_type
ASIO_DECL void start_resolve_op(operation *op)
void async_resolve(implementation_type &impl, const endpoint_type &endpoint, Handler &handler)
iterator_type resolve(implementation_type &, const endpoint_type &endpoint, asio::error_code &ec)
io_service_impl & io_service_impl_
Class to represent an error code value.
socket_ops::shared_cancel_token_type implementation_type
ASIO_DECL std::string host_name()
Get the current host name.
std::string host_name() const
Get the host name associated with the query.
std::string service_name() const
Get the service name associated with the query.
asio::error_code sync_getnameinfo(const socket_addr_type *addr, std::size_t addrlen, char *host, std::size_t hostlen, char *serv, std::size_t servlen, int sock_type, asio::error_code &ec)
void * allocate(std::size_t s, Handler &h)
asio::ip::basic_resolver_iterator< Protocol > iterator_type
#define ASIO_HANDLER_CREATION(args)
resolver_service(asio::io_service &io_service)
iterator_type resolve(implementation_type &, const query_type &query, asio::error_code &ec)
asio::error_code getaddrinfo(const char *host, const char *service, const addrinfo_type &hints, addrinfo_type **result, asio::error_code &ec)