artdaq  v3_09_00
SRSockets.hh
1 #ifndef SRSockets_hh
2 #define SRSockets_hh
3 #include <cstdint>
4 
5 // This file (SRSockets.hh) was created by Ron Rechenmacher <ron@fnal.gov> on
6 // Sep 14, 2016. "TERMS AND CONDITIONS" governing this file are in the README
7 // or COPYING file. If you do not have such a file, one can be obtained by
8 // contacting Ron or Fermi Lab in Batavia IL, 60510, phone: 630-840-3000.
9 // $RCSfile: .emacs.gnu,v $
10 // rev="$Revision: 1.30 $$Date: 2016/03/01 14:27:27 $";
11 
15 struct MessHead
16 {
17  uint8_t endian;
18 
24  enum MessType
25  {
26  connect_v0 = 0,
27  data_v0,
28  data_more_v0,
29  stop_v0,
30  routing_v0,
31  ack_v0,
32  header_v0
33  };
34 
36  int64_t source_id;
37 
38  union
39  {
40  uint32_t conn_magic;
41  int32_t byte_count;
42  };
43 };
44 
48 #define CONN_MAGIC 0xcafefeca
49 #define ACK_MAGIC 0xbeeffeed
50 #endif // SRSockets_hh
uint32_t conn_magic
unsigned first is better for MessHead initializer: {0,0,my_node_idx_,CONN_MAGIC}
Definition: SRSockets.hh:40
MessType
The Message Type.
Definition: SRSockets.hh:24
int32_t byte_count
use CONN_MAGIC for connect_v0, data that follow for data_v0 (and 0 lenght data)
Definition: SRSockets.hh:41
int64_t source_id
Rank of the source.
Definition: SRSockets.hh:36
MessType message_type
Message Type.
Definition: SRSockets.hh:35
This header is sent by the TCPSocket_transfer to allow for more efficient writev calls.
Definition: SRSockets.hh:15
uint8_t endian
0=little(intel), 1=big
Definition: SRSockets.hh:17