Multi-hop REQ/REP, part I., socket type is known to all associated objects

This commit is contained in:
Martin Sustrik
2010-02-12 13:33:50 +01:00
parent cd7300fd4f
commit 7b4cf2a4d0
11 changed files with 13 additions and 0 deletions

View File

@@ -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;
}

View File

@@ -23,6 +23,7 @@
#include "err.hpp"
zmq::options_t::options_t () :
type (-1),
hwm (0),
lwm (0),
swap (0),

View File

@@ -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;

View File

@@ -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;
}

View File

@@ -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;
}

View File

@@ -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;
}

View File

@@ -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;
}

View File

@@ -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);

View File

@@ -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;
}

View File

@@ -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;
}

View File

@@ -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;
}