Belle II Software
release-05-01-25
hsendcommand.cc
1
#include <daq/dataflow/EvtSocket.h>
2
#include <framework/pcore/EvtMessage.h>
3
#include <framework/pcore/MsgHandler.h>
4
5
#include "TText.h"
6
7
#include <stdio.h>
8
#include <string>
9
10
using namespace
Belle2
;
11
using namespace
std;
12
13
int
main
(
int
argc,
char
** argv)
14
{
15
if
(argc < 4) {
16
printf(
"Usage : hsendcommand cmd host port\n"
);
17
exit(-1);
18
}
19
string
cmd = string(argv[1]);
20
string
host = string(argv[2]);
21
int
port = atoi(argv[3]);
22
23
EvtSocketSend
* sock =
new
EvtSocketSend
(host.c_str(), port);
24
25
MsgHandler
hdl(0);
26
int
numobjs = 0;
27
28
TText command(0, 0, cmd.c_str());
29
hdl.add(&command, cmd.c_str());
30
numobjs++;
31
32
EvtMessage
* msg = hdl.encode_msg(MSG_EVENT);
33
(msg->
header
())->reserved[0] = 0;
34
(msg->
header
())->reserved[1] = numobjs;
35
36
sock->send(msg);
37
delete
(msg);
38
delete
(sock);
39
40
return
0;
41
}
Belle2::EvtSocketSend
Definition:
EvtSocket.h:26
Belle2::EvtMessage
Class to manage streamed object.
Definition:
EvtMessage.h:60
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::EvtMessage::header
EvtHeader * header()
Get pointer to EvtHeader.
Definition:
EvtMessage.cc:162
Belle2::MsgHandler
A class to encode/decode an EvtMessage.
Definition:
MsgHandler.h:104
daq
dqm
tools
hsendcommand.cc
Generated on Fri Nov 5 2021 03:49:03 for Belle II Software by
1.8.17