[zeromq-dev] protocol design question

Chuck Remes cremes.devlist at mac.com
Tue Nov 15 20:59:12 CET 2011


I am working on a protocol for submission to the rfc.zeromq.com site. For one of the fields (message frames) I need to define a unique sequence number. I decided upon a combination of a 64-bit integer and a 16-byte UUID.

The UUID would uniquely identify each client. The sequence number would uniquely identify each message from that client. When used together, each message from N clients can be uniquely identified.

So, I thought I should define the frame as follows:

frame 2
  24 bytes total
  8 bytes - 64-bit integer (network byte order)
  16 bytes - UUID

Is it portable to pack them both into the same frame like this? I assume a C user could define a struct to map that frame directly.

e.g.

struct sequence_id {
  uint64 number;
  uchar  uuid[16];
};

Is this all right? Or is there a better way to accomplish this framing?

cr




More information about the zeromq-dev mailing list