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) 37 template <
typename InternetProtocol>
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,
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;
151 service_name_(service)
153 typename InternetProtocol::endpoint endpoint;
154 hints_.ai_flags =
static_cast<int>(resolve_flags);
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,
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;
230 return service_name_;
235 std::string host_name_;
236 std::string service_name_;
244 #endif // ASIO_IP_BASIC_RESOLVER_QUERY_HPP const asio::detail::addrinfo_type & hints() const
Get the hints associated with the query.
An query to be passed to a resolver.
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.
basic_resolver_query(const std::string &service, resolver_query_base::flags resolve_flags=passive|address_configured)
Construct with specified service name for any protocol.
std::string host_name() const
Get the host name associated with the query.
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.
std::string service_name() const
Get the service name associated with the query.
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.
InternetProtocol protocol_type
The protocol type associated with the endpoint query.