mirror of
https://github.com/zeromq/libzmq.git
synced 2025-10-29 12:18:04 +01:00
Multi-hop REQ/REP, part I., socket type is known to all associated objects
This commit is contained in:
@@ -26,6 +26,7 @@
|
||||
zmq::downstream_t::downstream_t (class app_thread_t *parent_) :
|
||||
socket_base_t (parent_)
|
||||
{
|
||||
options.type = ZMQ_DOWNSTREAM;
|
||||
options.requires_in = false;
|
||||
options.requires_out = true;
|
||||
}
|
||||
|
||||
@@ -23,6 +23,7 @@
|
||||
#include "err.hpp"
|
||||
|
||||
zmq::options_t::options_t () :
|
||||
type (-1),
|
||||
hwm (0),
|
||||
lwm (0),
|
||||
swap (0),
|
||||
|
||||
@@ -34,6 +34,9 @@ namespace zmq
|
||||
|
||||
int setsockopt (int option_, const void *optval_, size_t optvallen_);
|
||||
|
||||
// Type of the associated socket. One of the constants defined in zmq.h
|
||||
int type;
|
||||
|
||||
int64_t hwm;
|
||||
int64_t lwm;
|
||||
int64_t swap;
|
||||
|
||||
@@ -29,6 +29,7 @@ zmq::p2p_t::p2p_t (class app_thread_t *parent_) :
|
||||
outpipe (NULL),
|
||||
alive (true)
|
||||
{
|
||||
options.type = ZMQ_P2P;
|
||||
options.requires_in = true;
|
||||
options.requires_out = true;
|
||||
}
|
||||
|
||||
@@ -27,6 +27,7 @@
|
||||
zmq::pub_t::pub_t (class app_thread_t *parent_) :
|
||||
socket_base_t (parent_)
|
||||
{
|
||||
options.type = ZMQ_PUB;
|
||||
options.requires_in = false;
|
||||
options.requires_out = true;
|
||||
}
|
||||
|
||||
@@ -30,6 +30,7 @@ zmq::rep_t::rep_t (class app_thread_t *parent_) :
|
||||
waiting_for_reply (false),
|
||||
reply_pipe (NULL)
|
||||
{
|
||||
options.type = ZMQ_REP;
|
||||
options.requires_in = true;
|
||||
options.requires_out = true;
|
||||
}
|
||||
|
||||
@@ -30,6 +30,7 @@ zmq::req_t::req_t (class app_thread_t *parent_) :
|
||||
reply_pipe_active (false),
|
||||
reply_pipe (NULL)
|
||||
{
|
||||
options.type = ZMQ_REQ;
|
||||
options.requires_in = true;
|
||||
options.requires_out = true;
|
||||
}
|
||||
|
||||
@@ -28,6 +28,7 @@ zmq::sub_t::sub_t (class app_thread_t *parent_) :
|
||||
socket_base_t (parent_),
|
||||
has_message (false)
|
||||
{
|
||||
options.type = ZMQ_SUB;
|
||||
options.requires_in = true;
|
||||
options.requires_out = false;
|
||||
zmq_msg_init (&message);
|
||||
|
||||
@@ -25,6 +25,7 @@
|
||||
zmq::upstream_t::upstream_t (class app_thread_t *parent_) :
|
||||
socket_base_t (parent_)
|
||||
{
|
||||
options.type = ZMQ_UPSTREAM;
|
||||
options.requires_in = true;
|
||||
options.requires_out = false;
|
||||
}
|
||||
|
||||
@@ -25,6 +25,7 @@
|
||||
zmq::xrep_t::xrep_t (class app_thread_t *parent_) :
|
||||
socket_base_t (parent_)
|
||||
{
|
||||
options.type = ZMQ_XREP;
|
||||
options.requires_in = true;
|
||||
options.requires_out = true;
|
||||
}
|
||||
|
||||
@@ -25,6 +25,7 @@
|
||||
zmq::xreq_t::xreq_t (class app_thread_t *parent_) :
|
||||
socket_base_t (parent_)
|
||||
{
|
||||
options.type = ZMQ_REQ;
|
||||
options.requires_in = true;
|
||||
options.requires_out = true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user