21 #ifndef G_NET_RESOLVER_FUTURE__H
22 #define G_NET_RESOLVER_FUTURE__H
32 class ResolverFuture ;
59 typedef std::pair<Address,std::string> Pair ;
60 typedef std::vector<Address> List ;
62 ResolverFuture(
const std::string & host ,
const std::string & service ,
63 int family ,
bool dgram ,
bool for_async_hint =
false ) ;
82 std::string
reason()
const ;
89 std::string failure()
const ;
90 bool fetch( List & )
const ;
91 bool fetch( Pair & )
const ;
93 std::string none()
const ;
94 std::string ipvx()
const ;
97 bool m_numeric_service ;
100 const char * m_host_p ;
101 std::string m_service ;
102 const char * m_service_p ;
104 struct addrinfo m_ai_hint ;
107 struct addrinfo * m_ai ;
108 std::string m_reason ;
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.
std::string reason() const
Returns the reason for the error().
bool error() const
Returns true if name resolution failed or no suitable address was returned.
~ResolverFuture()
Destructor.
void run()
Does the name resolution.
A 'future' object for asynchronous name resolution, in practice holding just enough state for a singl...