File tree Expand file tree Collapse file tree 2 files changed +24
-0
lines changed Expand file tree Collapse file tree 2 files changed +24
-0
lines changed Original file line number Diff line number Diff line change @@ -118,3 +118,12 @@ TEST(message, equality_non_equal_lhs_empty)
118
118
const zmq::message_t msg_b (" Hi" , 2 );
119
119
ASSERT_NE (msg_a, msg_b);
120
120
}
121
+
122
+ #if defined(ZMQ_BUILD_DRAFT_API) && ZMQ_VERSION >= ZMQ_MAKE_VERSION(4, 2, 0)
123
+ TEST (message, routing_id_persists)
124
+ {
125
+ zmq::message_t msg;
126
+ msg.set_routing_id (123 );
127
+ ASSERT_EQ (123u , msg.routing_id ());
128
+ }
129
+ #endif
Original file line number Diff line number Diff line change @@ -396,6 +396,21 @@ class message_t
396
396
return value;
397
397
}
398
398
#endif
399
+
400
+ #if defined(ZMQ_BUILD_DRAFT_API) && ZMQ_VERSION >= ZMQ_MAKE_VERSION(4, 2, 0)
401
+ inline uint32_t routing_id () const
402
+ {
403
+ return zmq_msg_routing_id (const_cast <zmq_msg_t *>(&msg));
404
+ }
405
+
406
+ inline void set_routing_id (uint32_t routing_id)
407
+ {
408
+ int rc = zmq_msg_set_routing_id (&msg, routing_id);
409
+ if (rc != 0 )
410
+ throw error_t ();
411
+ }
412
+ #endif
413
+
399
414
/* * Dump content to string. Ascii chars are readable, the rest is printed as hex.
400
415
* Probably ridiculously slow.
401
416
*/
You can’t perform that action at this time.
0 commit comments