Belle II Software development
sm_client.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
9#include "daq/dataflow/SocketLib.h"
10
11#include <cstdio>
12#include <cstdlib>
13#include <unistd.h>
14
15using namespace std;
16using namespace Belle2;
17
18int main(int argc, char** argv)
19{
20 if (argc < 3) {
21 printf("Wrong number of arguments\n");
22 return 1;
23 }
24 SocketSend sock(argv[1], (unsigned short)atoi(argv[2]));
25
26 sleep(10);
27
28 int count = 0;
29 for (;;) {
30 int sendbuf = 4;
31 int is = write(sock.sock(), &sendbuf, 4);
32 printf("data sent (%d), ret=%d\n", count++, is);
33 sleep(1);
34 }
35 return 0;
36}
Abstract base class for different kinds of events.
STL namespace.