21#ifndef G_NET_RESOLVER_FUTURE_H
22#define G_NET_RESOLVER_FUTURE_H
33 class ResolverFuture ;
63 std::string canonicalName ;
65 using List = std::vector<Address> ;
67 ResolverFuture(
const std::string & host ,
const std::string & service ,
102 static
std::
string encode( const
std::
string & ,
bool ) ;
103 std::
string failure() const ;
104 bool fetch( List & ) const ;
105 bool fetch(
Result & ) const ;
106 bool failed() const ;
107 std::
string none() const ;
108 std::
string ipvx() const ;
112 bool m_numeric_service ;
114 const
char * m_host_p ;
115 std::
string m_service ;
116 const
char * m_service_p ;
118 struct addrinfo m_ai_hint {} ;
120 struct addrinfo * m_ai {
nullptr} ;
121 std::string m_reason ;
The GNet::Address class encapsulates a TCP/UDP transport address.
A 'future' shared-state class for asynchronous name resolution that holds parameters and results of a...
Result get()
Returns the resolved address after run() has completed.
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().
ResolverFuture(const std::string &host, const std::string &service, int family, const Resolver::Config &)
Constructor for resolving the given host and service names.
ResolverFuture & run() noexcept
Does the synchronous name resolution and stores the result.
~ResolverFuture()
Destructor.
A class for synchronous or asynchronous network name to address resolution.
Result structure for GNet::ResolverFuture::get().
A configuration structure for GNet::Resolver.