[zeromq-dev] Behavior of Labels, Identities, and Socket Types in 3.0
gregory.szorc at gmail.com
Thu Oct 27 03:26:02 CEST 2011
On 10/26/11 12:37 PM, MinRK wrote:
> Here's a script with pyzmq that runs various combinations of sockets,
> and a side-by-side diff comparing the behaviour when run with 2.1.10 vs
> Should be trivial to add more socket combinations.
I immediately noticed an inconsistency between the results and the docs.
> When a 'ZMQ_REQ' socket is connected to a 'ZMQ_ROUTER' socket, in addition to the
> _identity_ of the originating peer each message received shall contain an empty
> _delimiter_ message part. Hence, the entire structure of each received message
> as seen by the application becomes: one or more _identity_ (label) parts, an
> empty _delimiter_ part, and one or more _data parts_.
From your 3.0 output:
> Testing REQ -> ROUTER
> REQ sending 'hi': ok
> ROUTER receiving: ['REQ', 'O\xce\xb5\xee', 'hi']
No empty message :(
I noticed a commit in 3.0 today that seems to touch code at the heart of
I haven't tested that commit yet. Maybe it makes the code consistent
with the docs?
Anyway, I fixed my application by changing all the DEALER and ROUTER
sockets (back to) XREQ and XREP. Like I said in my initial post, I
prefer 3.0's explicit label model rather than the empty message
convention of 2.x. Still, I'd like some (official) feedback on expected
behavior and best practices for 3.0.
More information about the zeromq-dev