FACT++  1.0
void Dim::Setup ( const std::string &  dns = "",
const std::string &  host = "" 
)

Set the environment variable DIM_DNS_NODE to the given string and DIM_HOST_NODE to the IP-address through which this machine connects to the dns.

Parameters
dnsAddress of the Dim-dns
Examples:
chatserv.cc.

Definition at line 160 of file DimSetup.cc.

References GetLocalIp().

Referenced by Main::execute(), main(), and Main::PrintHelp().

161 {
162  if (dns.empty())
163  {
164  setenv("DIM_DNS_NODE", "...", 1);
165  //unsetenv("DIM_DNS_NODE");
166  //unsetenv("DIM_HOST_NODE");
167  return;
168  }
169 
170  const string loc = host.empty() ? Dim::GetLocalIp(dns.c_str()) : host;
171 
172  setenv("DIM_DNS_NODE", dns.c_str(), 1);
173  setenv("DIM_HOST_NODE", loc.c_str(), 1);
174 
175  cout << "Setting DIM_DNS_NODE =" << dns << endl;
176  cout << "Setting DIM_HOST_NODE=" << loc << endl;
177 }
std::string GetLocalIp(const std::string &dns="10.0.100.1")
Definition: DimSetup.cc:51

+ Here is the call graph for this function:

+ Here is the caller graph for this function: