[zeromq-dev] protocol design question

Alexander Altshuler alt at kaluga.ru
Tue Nov 15 21:30:51 CET 2011

Why not if you proper handle endianness?


-----Original Message-----
From: zeromq-dev-bounces at lists.zeromq.org
[mailto:zeromq-dev-bounces at lists.zeromq.org] On Behalf Of Chuck Remes
Sent: Tuesday, November 15, 2011 10:59 PM
To: ZeroMQ development list
Subject: [zeromq-dev] protocol design question

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.


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

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


zeromq-dev mailing list
zeromq-dev at lists.zeromq.org

More information about the zeromq-dev mailing list