mirror of
https://github.com/zeromq/libzmq.git
synced 2025-10-17 11:05:06 +02:00
Make ZMQ interoperate with ZMQ 2.x SUB sockets
Since ZMQ 2.x does not support subscription forwarding, it's not possible to use ZMQ 2.x SUB socket to receive messages from a PUB socket. This patch adds some compatibility layer so that ZMQ 2.x SUB socket receives messages from PUB socket.
This commit is contained in:
@@ -26,6 +26,7 @@
|
||||
|
||||
#include "fd.hpp"
|
||||
#include "i_engine.hpp"
|
||||
#include "i_msg_sink.hpp"
|
||||
#include "io_object.hpp"
|
||||
#include "encoder.hpp"
|
||||
#include "decoder.hpp"
|
||||
@@ -41,7 +42,7 @@ namespace zmq
|
||||
// This engine handles any socket with SOCK_STREAM semantics,
|
||||
// e.g. TCP socket or an UNIX domain socket.
|
||||
|
||||
class stream_engine_t : public io_object_t, public i_engine
|
||||
class stream_engine_t : public io_object_t, public i_engine, public i_msg_sink
|
||||
{
|
||||
public:
|
||||
|
||||
@@ -55,6 +56,9 @@ namespace zmq
|
||||
void activate_in ();
|
||||
void activate_out ();
|
||||
|
||||
// i_msg_sink interface implementation.
|
||||
virtual int push_msg (msg_t *msg_);
|
||||
|
||||
// i_poll_events interface implementation.
|
||||
void in_event ();
|
||||
void out_event ();
|
||||
|
Reference in New Issue
Block a user