Belle II Software  release-05-01-25
rb2sockr.cc
1 //+
2 // File : rb2sockr.cc
3 // Description : Get an event from RingBuffer and send it to socket
4 // Reverse Connection
5 //
6 // Author : Ryosuke Itoh, IPNS, KEK
7 // Date : 25 - Jul - 2013
8 //-
9 #include <string>
10 
11 #include "daq/rfarm/event/RevRb2Sock.h"
12 
13 using namespace Belle2;
14 using namespace std;
15 
16 int main(int argc, char** argv)
17 {
18  // Retrieve RingBuffer name[1], port number[2], Shmname[3], and id[4]
19  if (argc < 5) {
20  printf("syntax : rb2sock rbufname port\n");
21  exit(-1);
22  }
23 
24  string a1(argv[1]);
25  int a2 = atoi(argv[2]);
26  string a3(argv[3]);
27  int a4 = atoi(argv[4]);
28 
29  RevRb2Sock rs(a1, a2, a3, a4);
30 
31  for (;;) {
32  int stat = rs.SendEvent();
33  // printf ( "rb2sock : sending %d\n", stat );
34  if (stat <= 0) break;
35  }
36  exit(0);
37 }
38 
39 
40 
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::RevRb2Sock
Definition: RevRb2Sock.h:24