mirror of
https://github.com/zeromq/libzmq.git
synced 2025-10-28 11:31:56 +01:00
Problem: libzmq does not send ZMTP 3.1 sub/cancel commands
Solution: if all peers of a socket are >= 3.1 use sub/cancel commands instead of the old 0/1 messages. For backward compatibility, move the handling of 0/1 or sub/cancel command strings to the encoders, so that the right thing can be done depending on the protocol version. Do not set the command flag until the encoder, so that we can handle the inproc case (which skips the encoder).
This commit is contained in:
@@ -54,6 +54,9 @@ namespace zmq
|
||||
// Note that this structure needs to be explicitly constructed
|
||||
// (init functions) and destructed (close function).
|
||||
|
||||
static const char cancel_cmd_name[] = "\6CANCEL";
|
||||
static const char sub_cmd_name[] = "\x9SUBSCRIBE";
|
||||
|
||||
class msg_t
|
||||
{
|
||||
public:
|
||||
@@ -109,6 +112,8 @@ class msg_t
|
||||
int init_delimiter ();
|
||||
int init_join ();
|
||||
int init_leave ();
|
||||
int init_subscribe (const size_t size_, const unsigned char *topic);
|
||||
int init_cancel (const size_t size_, const unsigned char *topic);
|
||||
int close ();
|
||||
int move (msg_t &src_);
|
||||
int copy (msg_t &src_);
|
||||
|
||||
Reference in New Issue
Block a user