Problem: can't process ZMTP 3.1 cancel/subscribe commands

Solution: add some msg helpers to parse commands, and check for
subscribe or cancel commands and process them accordingly in the xpub
and xsub classes.
This commit is contained in:
Luca Boccassi
2018-05-28 18:00:11 +01:00
parent 681e53f369
commit d70714e877
10 changed files with 440 additions and 66 deletions

View File

@@ -163,7 +163,9 @@ int zmq::session_base_t::pull_msg (msg_t *msg_)
int zmq::session_base_t::push_msg (msg_t *msg_)
{
if (msg_->flags () & msg_t::command)
// pass subscribe/cancel to the sockets
if ((msg_->flags () & msg_t::command) && !msg_->is_subscribe ()
&& !msg_->is_cancel ())
return 0;
if (_pipe && _pipe->write (msg_)) {
int rc = msg_->init ();