Logo Search packages:      
Sourcecode: pwlib version File versions  Download package

PString PIPSocket::GetHostName (  )  [static, inherited]

Get the "official" host name for the host specified or if none, the host this process is running on. The host may be specified as an IP number or a hostname alias and is resolved to the canonical form.

Returns:
Name of the host or IP number of host.

Definition at line 1740 of file sockets.cxx.

Referenced by PIPSocket::GetHostAddress(), PIPSocket::GetHostName(), PIPSocket::GetLocalHostName(), PIPSocket::GetName(), PIPSocket::GetPeerHostName(), PIPSocket::IsLocalHost(), PIpAccessControlEntry::Match(), PSMTPServer::OnEHLO(), PSMTPServer::OnHELO(), PPOP3Server::OnOpen(), and PSMTPServer::OnOpen().

{
  char name[100];
  if (gethostname(name, sizeof(name)-1) != 0)
    return "localhost";
  name[sizeof(name)-1] = '\0';
  return name;
}


Generated by  Doxygen 1.6.0   Back to index