11 #ifndef ASIO_IP_BASIC_RESOLVER_QUERY_HPP 12 #define ASIO_IP_BASIC_RESOLVER_QUERY_HPP 14 #if defined(_MSC_VER) && (_MSC_VER >= 1200) 16 #endif // defined(_MSC_VER) && (_MSC_VER >= 1200) 18 #include "asio/detail/config.hpp" 20 #include "asio/detail/socket_ops.hpp" 21 #include "asio/ip/resolver_query_base.hpp" 23 #include "asio/detail/push_options.hpp" 37 template <
typename InternetProtocol>
63 resolver_query_base::flags resolve_flags = passive | address_configured)
66 service_name_(service)
68 typename InternetProtocol::endpoint endpoint;
69 hints_.ai_flags =
static_cast<int>(resolve_flags);
70 hints_.ai_family = PF_UNSPEC;
71 hints_.ai_socktype = endpoint.protocol().type();
72 hints_.ai_protocol = endpoint.protocol().protocol();
73 hints_.ai_addrlen = 0;
74 hints_.ai_canonname = 0;
100 const std::string& service,
101 resolver_query_base::flags resolve_flags = passive | address_configured)
104 service_name_(service)
106 hints_.ai_flags =
static_cast<int>(resolve_flags);
107 hints_.ai_family = protocol.family();
108 hints_.ai_socktype = protocol.type();
109 hints_.ai_protocol = protocol.protocol();
110 hints_.ai_addrlen = 0;
111 hints_.ai_canonname = 0;
148 resolver_query_base::flags resolve_flags = address_configured)
151 service_name_(service)
153 typename InternetProtocol::endpoint endpoint;
154 hints_.ai_flags =
static_cast<int>(resolve_flags);
155 hints_.ai_family = ASIO_OS_DEF(AF_UNSPEC);
156 hints_.ai_socktype = endpoint.protocol().type();
157 hints_.ai_protocol = endpoint.protocol().protocol();
158 hints_.ai_addrlen = 0;
159 hints_.ai_canonname = 0;
199 const std::string& host,
const std::string& service,
200 resolver_query_base::flags resolve_flags = address_configured)
203 service_name_(service)
205 hints_.ai_flags =
static_cast<int>(resolve_flags);
206 hints_.ai_family = protocol.family();
207 hints_.ai_socktype = protocol.type();
208 hints_.ai_protocol = protocol.protocol();
209 hints_.ai_addrlen = 0;
210 hints_.ai_canonname = 0;
216 const asio::detail::addrinfo_type&
hints()
const 230 return service_name_;
234 asio::detail::addrinfo_type hints_;
235 std::string host_name_;
236 std::string service_name_;
242 #include "asio/detail/pop_options.hpp" 244 #endif // ASIO_IP_BASIC_RESOLVER_QUERY_HPP An query to be passed to a resolver.
Definition: basic_resolver_query.hpp:38
const asio::detail::addrinfo_type & hints() const
Get the hints associated with the query.
Definition: basic_resolver_query.hpp:216
basic_resolver_query(const std::string &host, const std::string &service, resolver_query_base::flags resolve_flags=address_configured)
Construct with specified host name and service name for any protocol.
Definition: basic_resolver_query.hpp:147
std::string service_name() const
Get the service name associated with the query.
Definition: basic_resolver_query.hpp:228
basic_resolver_query(const std::string &service, resolver_query_base::flags resolve_flags=passive|address_configured)
Construct with specified service name for any protocol.
Definition: basic_resolver_query.hpp:62
std::string host_name() const
Get the host name associated with the query.
Definition: basic_resolver_query.hpp:222
basic_resolver_query(const protocol_type &protocol, const std::string &service, resolver_query_base::flags resolve_flags=passive|address_configured)
Construct with specified service name for a given protocol.
Definition: basic_resolver_query.hpp:99
The resolver_query_base class is used as a base for the basic_resolver_query class templates to provi...
Definition: resolver_query_base.hpp:29
basic_resolver_query(const protocol_type &protocol, const std::string &host, const std::string &service, resolver_query_base::flags resolve_flags=address_configured)
Construct with specified host name and service name for a given protocol.
Definition: basic_resolver_query.hpp:198
InternetProtocol protocol_type
The protocol type associated with the endpoint query.
Definition: basic_resolver_query.hpp:43
Definition: any_io_executor.hpp:28