summaryrefslogtreecommitdiff
path: root/src/pipe.cpp
diff options
context:
space:
mode:
authorMartin Lucina <martin@lucina.net>2012-05-20 07:40:11 +0200
committerMartin Sustrik <sustrik@250bpm.com>2012-05-25 14:02:16 +0200
commita34ea4d80609395150742259fd8c9caa4409e961 (patch)
treeaa5c1793e7e5e276e4ded626adbe042e75740ff6 /src/pipe.cpp
parent6b7089891bdb3a4c55b43d0854787c96fae3bf2b (diff)
Implement SP wire protocol
Implements the SP wire protocol, and infrastructure for legacy wire protocol support. Also added an XS_SERVICE_ID socket option to set the service id and renamed the XS_PROTOCOL option to XS_PATTERN_VERSION. The following pattern versions are supported: PAIR: v3 PUBSUB: v1 (legacy), v4 REQREP: v2 PIPELINE: v3 SURVEY: v2 Note that all existing pattern versions have been bumped by 1 to allow for use of legacy protocols (otherwise there would be no way to distinguish between e.g. PUBSUB v3 and PUBSUB v3 using SP). Signed-off-by: Martin Lucina <martin@lucina.net>
Diffstat (limited to 'src/pipe.cpp')
-rw-r--r--src/pipe.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/pipe.cpp b/src/pipe.cpp
index 0a15cc0..c14642f 100644
--- a/src/pipe.cpp
+++ b/src/pipe.cpp
@@ -27,7 +27,7 @@
#include "err.hpp"
int xs::pipepair (class object_t *parents_ [2], class pipe_t* pipes_ [2],
- int hwms_ [2], bool delays_ [2], int protocol_)
+ int hwms_ [2], bool delays_ [2], int sp_version_)
{
// Creates two pipe objects. These objects are connected by two ypipes,
// each to pass messages in one direction.
@@ -38,10 +38,10 @@ int xs::pipepair (class object_t *parents_ [2], class pipe_t* pipes_ [2],
alloc_assert (upipe2);
pipes_ [0] = new (std::nothrow) pipe_t (parents_ [0], upipe1, upipe2,
- hwms_ [1], hwms_ [0], delays_ [0], protocol_);
+ hwms_ [1], hwms_ [0], delays_ [0], sp_version_);
alloc_assert (pipes_ [0]);
pipes_ [1] = new (std::nothrow) pipe_t (parents_ [1], upipe2, upipe1,
- hwms_ [0], hwms_ [1], delays_ [1], protocol_);
+ hwms_ [0], hwms_ [1], delays_ [1], sp_version_);
alloc_assert (pipes_ [1]);
pipes_ [0]->set_peer (pipes_ [1]);
@@ -51,7 +51,7 @@ int xs::pipepair (class object_t *parents_ [2], class pipe_t* pipes_ [2],
}
xs::pipe_t::pipe_t (object_t *parent_, upipe_t *inpipe_, upipe_t *outpipe_,
- int inhwm_, int outhwm_, bool delay_, int protocol_) :
+ int inhwm_, int outhwm_, bool delay_, int sp_version_) :
object_t (parent_),
inpipe (inpipe_),
outpipe (outpipe_),
@@ -66,7 +66,7 @@ xs::pipe_t::pipe_t (object_t *parent_, upipe_t *inpipe_, upipe_t *outpipe_,
sink (NULL),
state (active),
delay (delay_),
- protocol (protocol_)
+ sp_version (sp_version_)
{
}
@@ -386,9 +386,9 @@ void xs::pipe_t::terminate (bool delay_)
}
}
-int xs::pipe_t::get_protocol ()
+int xs::pipe_t::get_sp_version ()
{
- return protocol;
+ return sp_version;
}
bool xs::pipe_t::is_delimiter (msg_t &msg_)