Add message_t::routing_id() and set_routing_id()

Setting a routing id is necessary when sending a message through a
ZMQ_SERVER socket. See [1] for more details.

[1] http://api.zeromq.org/4-2:zmq-socket#toc5
This commit is contained in:
Joseph Artsimovich
2018-05-19 08:44:41 +03:00
parent b11e44550a
commit d4374cbebe
2 changed files with 24 additions and 0 deletions

View File

@@ -118,3 +118,12 @@ TEST(message, equality_non_equal_lhs_empty)
const zmq::message_t msg_b("Hi", 2);
ASSERT_NE(msg_a, msg_b);
}
#if defined(ZMQ_BUILD_DRAFT_API) && ZMQ_VERSION >= ZMQ_MAKE_VERSION(4, 2, 0)
TEST(message, routing_id_persists)
{
zmq::message_t msg;
msg.set_routing_id(123);
ASSERT_EQ(123u, msg.routing_id());
}
#endif