From ec81f8fb2523e1e2fe45eaadc05311a35bf551d7 Mon Sep 17 00:00:00 2001 From: Martin Sustrik Date: Wed, 22 Jun 2011 11:02:16 +0200 Subject: New wire format for REQ/REP pattern This patch introduces two changes: 1. 32-bit ID is used to identify the peer instead of UUID 2. REQ socket seeds the label stack with unique 32-bit request ID It also drops any replies with non-matching request ID Signed-off-by: Martin Sustrik --- src/req.hpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/req.hpp') diff --git a/src/req.hpp b/src/req.hpp index e0554ac..50dcb44 100644 --- a/src/req.hpp +++ b/src/req.hpp @@ -22,6 +22,7 @@ #define __ZMQ_REQ_HPP_INCLUDED__ #include "xreq.hpp" +#include "stdint.hpp" namespace zmq { @@ -49,6 +50,10 @@ namespace zmq // of the message must be empty message part (backtrace stack bottom). bool message_begins; + // Request ID. Request numbers gradually increase (and wrap over) + // so that we don't have to generate random ID for each request. + uint32_t request_id; + req_t (const req_t&); const req_t &operator = (const req_t&); }; -- cgit v1.2.3