[zeromq-dev] protocol design question

Chuck Remes cremes.devlist at mac.com
Wed Nov 16 16:11:27 CET 2011


On Nov 16, 2011, at 1:19 AM, Martin Sustrik wrote:

> Hi Chuck,
> 
>> The UUID would uniquely identify each client.
> 
> Give some thought to what do you want to uniquely identify. Is it any client ever? If so, UUID is probably the right way to go. However, if all you need is to uniquely identify a client of a particular server instance, 32-bit integer should do.

I need to uniquely identify the client for the life of the service. I assume the service could live for days, weeks or months (years seems a stretch). How would I choose a 32-bit integer independently from many hosts and avoid collisions?

The issue of collisions is why I chose UUID. If you have an algorithm for achieving this with a 32-bit integer, please share. I would gladly use it to save 12-bytes out of each message.

cr




More information about the zeromq-dev mailing list