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