[zeromq-dev] Raw protocol spec for REQ/REP socket?

Gary Shi garyshi at gmail.com
Tue Apr 26 12:54:20 CEST 2011


Thanks, it answers my question very well.

On Mon, Apr 25, 2011 at 6:59 PM, Martin Sustrik <sustrik at 250bpm.com> wrote:
> Hi Gary,
>
>> I want to implement part of the ZeroMQ protocol so I can write
>> programs interact with it,
>> on platforms where ZeroMQ is not available. And I found REQ/REP
>> packets different with
>> 2/SPB: both side make a first connection, sending 1 packet of
>> \x01\x00; close it then send
>> REQ/REP messages, but all messages are prefixed by \x01\x01. What's
>> the use of them?
>> I also checked PUB messages, they're not prefixed. Is it safe to just
>> append \x01\x01 in
>> front of the SPB messages to talk to a ZeroMQ REP server?
>
> The basic framing for TCP is described in zmq_tcp(7), the basic framing for
> PGM is described in zmq_pgm(7).
>
> The first message sent by each TCP peer is its identity. If there's no
> identity set, the message is empty (\x01\x00).
>
> For REQ/REP there's an envelope (ie. backtrace stack) in each message. For
> description, look here:
>
> http://www.zeromq.org/tutorials:xreq-and-xrep
>
> Martin
>



-- 
regards,
Gary Shi



More information about the zeromq-dev mailing list