diff options
author | Martin Sustrik <sustrik@250bpm.com> | 2011-06-22 11:02:16 +0200 |
---|---|---|
committer | Martin Sustrik <sustrik@250bpm.com> | 2011-06-22 11:02:16 +0200 |
commit | ec81f8fb2523e1e2fe45eaadc05311a35bf551d7 (patch) | |
tree | e6fbd9b7a789d72678fa02ca06883de15a932beb /src/req.hpp | |
parent | 10a93bb79fd3d4be1b3ffedfa6785564fbcc082b (diff) |
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 <sustrik@250bpm.com>
Diffstat (limited to 'src/req.hpp')
-rw-r--r-- | src/req.hpp | 5 |
1 files changed, 5 insertions, 0 deletions
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&); }; |