diff options
author | Martin Lucina <martin@lucina.net> | 2012-05-20 07:40:11 +0200 |
---|---|---|
committer | Martin Sustrik <sustrik@250bpm.com> | 2012-05-25 14:02:16 +0200 |
commit | a34ea4d80609395150742259fd8c9caa4409e961 (patch) | |
tree | aa5c1793e7e5e276e4ded626adbe042e75740ff6 /src/pipe.hpp | |
parent | 6b7089891bdb3a4c55b43d0854787c96fae3bf2b (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.hpp')
-rw-r--r-- | src/pipe.hpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/pipe.hpp b/src/pipe.hpp index c298154..dbc6b7e 100644 --- a/src/pipe.hpp +++ b/src/pipe.hpp @@ -44,7 +44,7 @@ namespace xs // pipe receives all the pending messages before terminating, otherwise it // terminates straight away. int pipepair (xs::object_t *parents_ [2], xs::pipe_t* pipes_ [2], - int hwms_ [2], bool delays_ [2], int protocol_); + int hwms_ [2], bool delays_ [2], int sp_version_); struct i_pipe_events { @@ -69,7 +69,7 @@ namespace xs // This allows pipepair to create pipe objects. friend int pipepair (xs::object_t *parents_ [2], xs::pipe_t* pipes_ [2], int hwms_ [2], bool delays_ [2], - int protocol_); + int sp_version_); public: @@ -111,8 +111,8 @@ namespace xs // before actual shutdown. void terminate (bool delay_); - // Returns the ID of the protocol associated with the pipe. - int get_protocol (); + // Returns the SP pattern version in use on this pipe. + int get_sp_version (); private: @@ -132,7 +132,7 @@ namespace xs // Constructor is private. Pipe can only be created using // pipepair function. 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_); // Pipepair uses this function to let us know about // the peer pipe object. @@ -192,9 +192,9 @@ namespace xs // asks us to. bool delay; - // ID of the protocol to use. This value is not used by the pipe - // itself, rather it's used by the users of the pipe. - int protocol; + // SP pattern version in use on this pipe. This value is used by the + // pattern classes using the pipe, not the pipe itself. + int sp_version; // Identity of the writer. Used uniquely by the reader side. blob_t identity; |