21#ifndef G_NET_RESOLVER_H
22#define G_NET_RESOLVER_H
48 G_EXCEPTION( Error ,
tx(
"asynchronous resolver error") ) ;
49 G_EXCEPTION( BusyError ,
tx(
"asynchronous resolver still busy") ) ;
50 using AddressList = std::vector<Address> ;
79 static AddressList
resolve(
const std::string & host ,
const std::string & service ,
int family = AF_UNSPEC ,
bool dgram =
false ) ;
98 friend class GNet::ResolverImp ;
99 void done(
const std::string & ,
const Location & ) ;
104 std::unique_ptr<ResolverImp> m_imp ;
A tuple containing an ExceptionHandler interface pointer and a bound 'exception source' pointer.
A class that represents the remote target for out-going client connections.
A class for synchronous or asynchronous network name to address resolution.
static std::string resolve(Location &)
Does synchronous name resolution.
Resolver(Callback &, ExceptionSink)
Constructor taking a callback interface reference.
static bool async()
Returns true if the resolver supports asynchronous operation.
void start(const Location &)
Starts asynchronous name-to-address resolution.
bool busy() const
Returns true if there is a pending resolve request.
constexpr const char * tx(const char *p)
A briefer alternative to G::gettext_noop().
An interface used for GNet::Resolver callbacks.
virtual ~Callback()=default
Destructor.
virtual void onResolved(std::string error, Location)=0
Called on completion of GNet::Resolver name resolution.