Belle II Software  release-05-02-19
EvtSocket.h
1 #ifndef EVTSOCKET_H
2 #define EVTSOCKET_H
3 //+
4 // File : EvtSocket.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/SocketLib.h>
14 #include <framework/pcore/EvtMessage.h>
15 
16 #define MAXEVTSIZE 80000000
17 
18 namespace Belle2 {
24  typedef unsigned short u_short;
25 
26  class EvtSocketSend {
27  public:
28  EvtSocketSend(std::string hostname, int port);
29  ~EvtSocketSend();
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  int recv_pxd_buffer(char* buf);
39 
40  SocketSend* sock(void);
41 
42  private:
43  SocketSend* m_sock;
44  char* m_recbuf;
45  };
46 
47  class EvtSocketRecv {
48  public:
49  EvtSocketRecv(int port, bool accept_at_init = true);
50  ~EvtSocketRecv();
51 
52  int status();
53 
54  int send(EvtMessage* msg);
55  EvtMessage* recv(void);
56 
57  int send_buffer(int size, char* buf);
58  int recv_buffer(char* buf);
59 
60  SocketRecv* sock(void);
61 
62  private:
63  SocketRecv* m_sock;
64  char* m_recbuf;
65  };
66 
68 }
69 
70 #endif
71 
72 
Belle2::EvtSocketSend
Definition: EvtSocket.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::SocketSend
Definition: SocketLib.h:84
Belle2::EvtSocketRecv
Definition: EvtSocket.h:47
Belle2::SocketRecv
Definition: SocketLib.h:48