[zeromq-dev] empty packet if REQ

Martin Sustrik sustrik at 250bpm.com
Fri Aug 13 12:54:10 CEST 2010


> Could you please describe in more detailed way in which cases these extra identities are appended.
> (1)                  (2)                (3)
> REQ-send                          XREP-recv
> ID1                                     ID2
> null                                     ID1
> payload                               null
>                                           payload

Actually, the identity as added by XREP socket so it looks like this:


payload ---> (REQ) --- null|payload --> (XREP) ---  id1|null|payload 
---> (XREQ) --- id1|null|payload ---> (REP) ---> payload


payload ---> (REP) --- id1|null|payload ---> (XREQ) --- id1|null|payload 
---> (XREP) ---> null|payload ---> (REQ) ---> payload

> The question is what should be done at (2) in 0mq API terms to have extra identity added.

As already said XREP is the socket resposible for adding removing 
identities. So it adds identity of the peer to the request and sends it 

When it gets the reply. It chops one identity from the backtrace stack 
and uses it to route the reply to the right peer.


More information about the zeromq-dev mailing list