[zeromq-dev] "Who said that?"

Oliver Smith oliver at kfs.org
Wed Dec 15 23:34:22 CET 2010

Trying to re-remember how to obtain the return address for a given ZMQ 
message, or the ZMQ representation thereof (a UUID or something). The 
message originator might be behind a NAT system, so the originating 
address could be useless (there are too many in the world).

What I want to know is, where does the ZMQ interface I got this message 
from think it came from? So that I can distinguish messages from 
different incoming streams behind the multiplexed socket I'm talking to.

Consider the following pseudo code:

     msg = interface.receive()
     user = userLookup(msg.streamIdentifier)
     if user:

I realize I could just slap some kind of GUID into the payload, but in 
these particular message streams, bits are at a premium.

I recognize that the sender address/port in an IP packet should never be 
trusted any more than the words "PRIORITY MAIL" or "YOU'VE WON 
$10,000,000!" on a physical envelope, however in my particular use case 
- and for similar reasons - it makes an excellent starting point.

- Oliver

More information about the zeromq-dev mailing list