Belle II Software  release-05-01-25
rf_outputserver.cc
1 //+
2 // File : RFEventServer.cc
3 // Description : Receive data from event builder 1 and distribute them to
4 // Processing nodes
5 //
6 // Author : Ryosuke Itoh, IPNS, KEK
7 // Date : 24 - June - 2013
8 //-
9 #include "daq/rfarm/manager/RFOutputServer.h"
10 #include "daq/rfarm/manager/RFNSM.h"
11 
12 #include <csignal>
13 
14 using namespace std;
15 using namespace Belle2;
16 
17 static RFOutputServer* ots = NULL;
18 
19 extern "C" void sighandler(int sig)
20 {
21  printf("SIGTERM handler here\n");
22  ots->cleanup();
23 }
24 
25 int main(int argc, char** argv)
26 {
27  RFConf conf(argv[1]);
28 
29  // Creation of event server instance. evs contains the instance
30  // RFOutputServer& ots = RFOutputServer::Create ( argv[1] );
31 
32  // RFOutputServer* ots = new RFOutputServer(argv[1]);
33  ots = new RFOutputServer(argv[1]);
34 
35  signal(SIGINT, sighandler);
36  signal(SIGTERM, sighandler);
37 
38  RFNSM nsm(conf.getconf("collector", "nodename"), ots);
39  nsm.AllocMem(conf.getconf("system", "nsmdata"));
40  ots->SetNodeInfo(nsm.GetNodeInfo());
41 
42  ots->server();
43 
44 }
Belle2::RFOutputServer
Definition: RFOutputServer.h:30
main
int main(int argc, char **argv)
Run all tests.
Definition: test_main.cc:77
Belle2
Abstract base class for different kinds of events.
Definition: MillepedeAlgorithm.h:19
Belle2::RFNSM
Definition: RFNSM.h:61
Belle2::RFConf
Definition: RFConf.h:24