28std::string GNet::Local::m_name_override ;
29bool GNet::Local::m_name_override_set = false ;
39std::string GNet::Local::resolvedHostname()
41 static std::string result ;
42 static bool first = true ;
48 result = ok ? location.name() : (
hostname()+
".localnet") ;
55 return m_name_override_set ? m_name_override : resolvedHostname() ;
60 m_name_override = name_override ;
61 m_name_override_set = true ;
67 return address.
isLocal( reason ) ;
73 return isLocal( address , reason ) ;
The GNet::Address class encapsulates a TCP/UDP transport address.
bool isLocal(std::string &reason) const
Returns true if this seems to be a 'local' address, ie.
static bool isLocal(const Address &, std::string &reason)
Returns true if the given address appears to be 'local', or a helpful error message if not.
static std::string canonicalName()
Returns the canonical network name assiciated with hostname().
static std::string hostname()
Returns the local hostname. Returns "localhost" on error.
A class that represents the remote target for out-going client connections.
static std::string resolve(Location &)
Does synchronous name resolution.
std::string hostname()
Returns the hostname.