Belle II Software  release-05-01-25
REvtSocket.h
1 #ifndef REVTSOCKET_H
2 #define REVTSOCKET_H
3 //+
4 // File : REvtSocket.h
5 // Description : Socket I/O interface for EvtMessage
6 //
7 // Author : Ryosuke Itoh, IPNS, KEK
8 // Date : 4 - Aug - 2011
9 //-
10 
11 #include <string>
12 
13 #include <daq/dataflow/RSocketLib.h>
14 #include <framework/pcore/EvtMessage.h>
15 
16 #define MAXEVTSIZE 80000000
17 
18 namespace Belle2 {
24  typedef unsigned short u_short;
25 
27  public:
28  REvtSocketRecv(std::string hostname, int port);
29  ~REvtSocketRecv();
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);
49  ~REvtSocketSend();
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 
Belle2::RSocketRecv
Definition: RSocketLib.h:58
Belle2::REvtSocketRecv
Definition: REvtSocket.h:26
Belle2::EvtMessage
Class to manage streamed object.
Definition: EvtMessage.h:60
Belle2
Abstract base class for different kinds of events.
Definition: MillepedeAlgorithm.h:19
Belle2::RSocketSend
Definition: RSocketLib.h:25
Belle2::REvtSocketSend
Definition: REvtSocket.h:46