FACT++  1.0
log.cc
Go to the documentation of this file.
1 #include "MessageDim.h"
2 
3 #include "tools.h"
4 
5 #include <iostream>
6 
7 int main(int, const char **argv)
8 {
9  // We could use putenv to make the Configure class change the value...
10  setenv("DIM_DNS_NODE", "localhost", 0);
11 
12  // Get the name of the server we should subscribe to from the cmd line
13  const std::string server = argv[1] ? argv[1] : "TIME";
14 
15  // Some info on the console
16  std::cout << "Subscribing to " << server << "/MESSAGE...\n" << std::endl;
17 
18  // Create a message handler (default: redirects to stdout)
19  MessageImp msg;
20 
21  // Subscribe to SERVER/MESSAGE and start output
22  MessageDimRX msgrx(server, msg);
23 
24  // Just do nothing ;)
25  while (1)
26  usleep(1);
27 
28  return 0;
29 }
30 
31 // **************************************************************************
43 // **************************************************************************
The base implementation of a distributed messaging system.
Definition: MessageImp.h:10
int main(int, const char **argv)
Definition: log.cc:7
Based on MessageImp, subscribes to a MESSAGE service in the Dim network.
Definition: MessageDim.h:34