21#ifndef G_NET_RESOLVER_H
22#define G_NET_RESOLVER_H
46 using AddressList = std::vector<Address> ;
47 G_EXCEPTION( Error ,
"asynchronous resolver error" ) ;
48 G_EXCEPTION( BusyError ,
"asynchronous resolver still busy" ) ;
77 static AddressList
resolve(
const std::string & host ,
const std::string & service ,
int family = AF_UNSPEC ,
bool dgram =
false ) ;
92 void operator=(
const Resolver & ) = delete ;
93 void operator=(
Resolver && ) = delete ;
97 void done(
const std::string & ,
const Location & ) ;
102 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 private "pimple" implementation class used by GNet::Resolver to do asynchronous name resolution.
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.
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.