FACT++  1.0
int main ( int  argc,
const char **  argv 
)

Definition at line 574 of file ftm.cc.

References Configuration::Get(), Configuration::HasHelp(), Configuration::HasPrint(), Configuration::HasVersion(), Configuration::Parse(), Port, Dim::Setup(), and SetupConfiguration().

575 {
576  ::Configuration conf(argv[0]);
577 
578  SetupConfiguration(conf);
579 
580  po::variables_map vm;
581  try
582  {
583  vm = conf.Parse(argc, argv);
584  }
585 #if BOOST_VERSION > 104000
586  catch (po::multiple_occurrences &e)
587  {
588  cerr << "Program options invalid due to: " << e.what() << " of '" << e.get_option_name() << "'." << endl;
589  return -1;
590  }
591 #endif
592  catch (exception& e)
593  {
594  cerr << "Program options invalid due to: " << e.what() << endl;
595  return -1;
596  }
597 
598  if (conf.HasVersion() || conf.HasPrint() || conf.HasHelp())
599  return -1;
600 
601  Dim::Setup(conf.Get<string>("dns"));
602 
603  //try
604  {
605  ba::io_service io_service;
606 
607  Port = conf.Get<uint16_t>("port");
608 
609  tcp_server server(io_service, Port);
610  // ba::add_service(io_service, &server);
611  // server.add_service(...);
612  //cout << "Run..." << flush;
613 
614  // Calling run() from a single thread ensures no concurrent access
615  // of the handler which are called!!!
616  io_service.run();
617 
618  //cout << "end." << endl;
619  }
620  /*catch (std::exception& e)
621  {
622  std::cerr << e.what() << std::endl;
623  }*/
624 
625  return 0;
626 }
void Setup(const std::string &dns="", const std::string &host="")
Definition: DimSetup.cc:160
int Port
Definition: ftm.cc:27
void SetupConfiguration(::Configuration &conf)
Definition: ftm.cc:554
Commandline parsing, resource file parsing and database access.
Definition: Configuration.h:9

+ Here is the call graph for this function: