Belle II Software development
REvtSocket.h
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#ifndef REVTSOCKET_H
9#define REVTSOCKET_H
10
11#include <string>
12
13#include <daq/dataflow/RSocketLib.h>
14#include <framework/pcore/EvtMessage.h>
15
16#define MAXEVTSIZE 80000000
17
18namespace Belle2 {
24 typedef unsigned short u_short;
25
27 public:
28 REvtSocketRecv(std::string hostname, int port);
30
31 int status();
32
33 int send(EvtMessage* msg);
34 EvtMessage* recv(void);
35
36 int send_buffer(int size, char* buf);
37 int recv_buffer(char* buf);
38
39 RSocketRecv* sock(void);
40
41 private:
42 RSocketRecv* m_sock;
43 char* m_recbuf;
44 };
45
47 public:
48 REvtSocketSend(int port, bool accept_at_init = true);
50
51 int status();
52
53 int send(EvtMessage* msg);
54 EvtMessage* recv(void);
55
56 int send_buffer(int size, char* buf);
57 int recv_buffer(char* buf);
58
59 RSocketSend* sock(void);
60
61 private:
62 RSocketSend* m_sock;
63 char* m_recbuf;
64 };
65
67}
68
69#endif
70
71
Class to manage streamed object.
Definition: EvtMessage.h:59
Abstract base class for different kinds of events.