Belle II Software  release-06-02-00
rf_outputserver.cc
1 /**************************************************************************
2  * basf2 (Belle II Analysis Software Framework) *
3  * Author: The Belle II Collaboration *
4  * *
5  * See git log for contributors and copyright holders. *
6  * This file is licensed under LGPL-3.0, see LICENSE.md. *
7  **************************************************************************/
8 #include "daq/rfarm/manager/RFOutputServer.h"
9 #include "daq/rfarm/manager/RFNSM.h"
10 
11 #include <csignal>
12 
13 using namespace std;
14 using namespace Belle2;
15 
16 static RFOutputServer* ots = NULL;
17 
18 extern "C" void sighandler(int sig)
19 {
20  printf("SIGTERM handler here\n");
21  ots->cleanup();
22 }
23 
24 int main(int argc, char** argv)
25 {
26  RFConf conf(argv[1]);
27 
28  // Creation of event server instance. evs contains the instance
29  // RFOutputServer& ots = RFOutputServer::Create ( argv[1] );
30 
31  // RFOutputServer* ots = new RFOutputServer(argv[1]);
32  ots = new RFOutputServer(argv[1]);
33 
34  signal(SIGINT, sighandler);
35  signal(SIGTERM, sighandler);
36 
37  RFNSM nsm(conf.getconf("collector", "nodename"), ots);
38  nsm.AllocMem(conf.getconf("system", "nsmdata"));
39  ots->SetNodeInfo(nsm.GetNodeInfo());
40 
41  ots->server();
42 
43 }
Abstract base class for different kinds of events.
int main(int argc, char **argv)
Run all tests.
Definition: test_main.cc:75