FACT++  1.0
int main ( int  ,
const char **   
)
Examples:
logtime.cc.

Definition at line 8 of file logtime.cc.

References dis_get_conn_id(), DimServer::getClientServices(), ids, MessageImp::Message(), and DimServer::start().

9 {
10  // We could use putenv to make the Configure class change the value...
11  setenv("DIM_DNS_NODE", "localhost", 0);
12 
13  // Start a DimServer called TIME
14  DimServer::start("TIME");
15 
16 
17 
18  // Some info on the console
19  std::cout << "Offering TIME/MESSAGE...\n" << std::endl;
20 
21  // Setup a DimService called TIME/MESSAGE
22  MessageDimTX msg("TIME");
23  while (1)
24  {
25  // Send current time
26  msg.Message(Time().GetAsStr());
27 
28  // wait approximately one second
29  usleep(1000000);
30 
31  //std::cout << DimServer::getClientName() << std::endl;
32  //std::cout << DimServer::getClientId() << std::endl;
33  //std::cout << DimServer::getDnsPort() << std::endl;
34  std::cout << "con: " << dis_get_conn_id() << std::endl;
35 
37 
38  while (*ids)
39  {
40  std::cout << *ids << std::endl;
41  ids++;
42  }
43  }
44 
45  return 0;
46 }
int ids[10]
Adds some functionality to boost::posix_time::ptime for our needs.
Definition: Time.h:30
int dis_get_conn_id()
Definition: dis.c:2795
Based on MessageImp, redirects log-output to a Dim service MESSAGE.
Definition: MessageDim.h:10
static void start()
Definition: discpp.cxx:512
static char ** getClientServices()
Definition: discpp.cxx:601

+ Here is the call graph for this function: