artdaq  v2_03_00
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Pages
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  };
32 
34  int64_t source_id;
35 
36  union
37  {
38  uint32_t conn_magic;
39  int32_t byte_count;
40  };
41 };
42 
46 #define CONN_MAGIC 0xcafefeca
47 #endif // SRSockets_hh
uint32_t conn_magic
unsigned first is better for MessHead initializer: {0,0,my_node_idx_,CONN_MAGIC}
Definition: SRSockets.hh:38
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:39
int64_t source_id
Rank of the source.
Definition: SRSockets.hh:34
MessType message_type
Message Type.
Definition: SRSockets.hh:33
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