[zeromq-dev] error in the guide?

Chuck Remes cremes.devlist at mac.com
Tue Jan 24 02:08:38 CET 2012

On Jan 23, 2012, at 7:01 PM, Martin Sustrik wrote:

> On 24/01/12 01:22, Chuck Remes wrote:
>> A DEALER socket is a synonym for XREQ and a ROUTER socket is a
>> synonym for XREP. The REQ&  REP sockets are built on top of those
>> other types. When sending data from a REQ to a ROUTER socket, for
>> example, you will see that the ROUTER socket receives the message as
>> IDENTITY + NUL part + payload. The NUL part is a requirement for
>> routing via intermediate devices. Eliminating that NUL part may work
>> for directly connected sockets, but the routing will very likely
>> break if there are any intermediate sockets (like a QUEUE device). If
>> it works without the NUL part, then it's probably just luck and we
>> shouldn't count on it working in the future.
> The best way to think about it, I think, is that XREP and XREQ handle 
> the addresses in the initial message parts. They know nothing about the 
> empty frame.
> REQ and REP are just thin end-to-end wrappers on top of XREQ and XREP. 
> The only thing they know about is the empty frame. REQ socket adds an 
> empty frame to the messages, REP socket blindly copies all message parts 
> up to the empty frame from the request to the reply etc.
> Thus, if the example in the quide doesn't use REQ and/or REP it doesn't 
> have to care about empty frames.

Sure, I get that. But if you ignore the convention (null delimiter) then you can't interoperate with REQ or REP sockets. Generally the user may want to do so in the future, so by not conforming to that message protocol with the null delimiter they are just limiting their future options.

I know it isn't strictly necessary but it still seems like a bug to me. 


More information about the zeromq-dev mailing list