21#ifndef G_NET_RESOLVER_FUTURE_H
22#define G_NET_RESOLVER_FUTURE_H
32 class ResolverFuture ;
59 using Pair = std::pair<Address,std::string> ;
60 using List = std::vector<Address> ;
62 ResolverFuture(
const std::string & host ,
const std::string & service ,
63 int family ,
bool dgram ,
bool for_async_hint =
false ) ;
85 std::string
reason()
const ;
96 std::string failure()
const ;
97 bool fetch( List & )
const ;
98 bool fetch( Pair & )
const ;
100 std::string none()
const ;
101 std::string ipvx()
const ;
104 bool m_numeric_service ;
107 const char * m_host_p ;
108 std::string m_service ;
109 const char * m_service_p ;
111 struct addrinfo m_ai_hint {} ;
114 struct addrinfo * m_ai ;
115 std::string m_reason ;
A 'future' shared-state class for asynchronous name resolution that holds parameters and results of a...
bool error() const
Returns true if name resolution failed or no suitable address was returned.
std::string reason() const
Returns the reason for the error().
Pair get()
Returns the resolved address/name pair after run() has completed.
ResolverFuture(const std::string &host, const std::string &service, int family, bool dgram, bool for_async_hint=false)
Constructor for resolving the given host and service names.
ResolverFuture & run() noexcept
Does the synchronous name resolution and stores the result.
~ResolverFuture()
Destructor.