[zeromq-dev] Raw protocol spec for REQ/REP socket?
Martin Sustrik
sustrik at 250bpm.com
Mon Apr 25 12:59:36 CEST 2011
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
More information about the zeromq-dev
mailing list