E-MailRelay
|
A static class for getting information about the local machine's network name and address. More...
#include <glocal.h>
Static Public Member Functions | |
static std::string | hostname () |
Returns the local hostname. Returns "localhost" on error. More... | |
static std::string | canonicalName () |
Returns the ASCII fully qualified domain name associated with hostname(). More... | |
A static class for getting information about the local machine's network name and address.
|
static |
Returns the ASCII fully qualified domain name associated with hostname().
The result of the first call is 'memoised'.
On Unix the implementation performs a synchronous DNS query on the hostname() and returns the canonical name. The hostname and the returned canonical name are converted to A-labels if necessary.
On Windows the 'ComputerNameDnsFullyQualified' value is returned, also converted to A-labels if necessary.
Defaults to "<hostname-as-a-label>.localnet" or even "localhost.localnet" if the result would otherwise be invalid.
Definition at line 35 of file glocal_unix.cpp.
|
static |
Returns the local hostname. Returns "localhost" on error.
Definition at line 27 of file glocal_unix.cpp.