[zeromq-dev] protocol design question
Chuck Remes
cremes.devlist at mac.com
Tue Nov 15 21:49:00 CET 2011
On Nov 15, 2011, at 2:37 PM, Pieter Hintjens wrote:
> On Tue, Nov 15, 2011 at 1:59 PM, Chuck Remes <cremes.devlist at mac.com> wrote:
>
>> 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.
>
> Sure, this is a good representation. For clarity you might put the
> UUID before the sequence number (it is the more natural order IMO).
Originally I had UUID first. However, many times the UUIDs generated on a single system differ only in the last few bytes. Anyone trying to compare these values to a saved value would probably want the "different" bytes to be closer to the front so a comparison could fail-fast. It's a minor performance consideration and I don't think it hurts the clarity of the frame. The idea is similar to how the first message part in a message sent to a SUB socket should have the most unique bits in front for the subscription filtering.
> Note that you can post Raw RFCs and refine them online. I.e. don't
> worry about getting them right up-front.
Good to know. I am working on something I call the Consensus protocol. I'll post it this week.
cr
More information about the zeromq-dev
mailing list