summaryrefslogtreecommitdiff
path: root/src/sub.cpp
AgeCommit message (Collapse)Author
2012-05-20Implement SP wire protocolspMartin Lucina
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>
2012-05-01Revert "Implement protocol versioning (except PGM)"Martin Sustrik
This reverts commit 512f3a604924fec9d89e2b4bfd6f73aa66309fa7.
2012-04-29Implement protocol versioning (except PGM)Martin Lucina
Implements SP protocol versioning, legacy protocol support, and the following pattern protocol versions: PAIR: v2 PUBSUB: v1 (legacy), v3 REQREP: v1 PIPELINE: v2 SURVEY: v1 Engine support is only for stream_engine_t at this stage. Signed-off-by: Martin Lucina <martin@lucina.net>
2012-04-15Filters can transform user subscriptions to wire subscriptionMartin Sustrik
Till now the subscription, as specified by the user, was send upstream. This patch allows SUB-side filter to transform the user subscription into wire subscription. For example, only a has can be sent upstream instead of a perfect subscription. Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2012-04-14Separate subscription forwarding from SUB-side filteringMartin Sustrik
- subscription forwarding is handled by XSUB socket - filtering is handled by SUB sockets - subscriptions are decoupled from filter engines - filter doesn't have to be able to enumarate the subscriptions (no sf_enumerate function) Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2012-04-05XS_PLUGIN and XS_FILTER implementationMartin Sustrik
This patch introduces following features: - XS_PLUGIN context option to add plugins to libxs - XS_FILTER option to switch between different filter types - Automatic loading of plug-ins is *not* implemented. From the implementation point of view: - standard prefix filter is implemented as a pluggable filter - trie_t and mtrie_t are joined into a single class - the code for 0MQ/3.1 compatibility is left in in the form of comments - new test for testing re-subscriptions is added Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2012-02-16Full name of the project used in license headersMartin Sustrik
Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2012-02-16Some additional parameter checking for ZMQ_(UN)SUBSCRIBEMartin Sustrik
Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2012-02-16poller_base_t renamed to io_thread_tMartin Sustrik
Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2012-02-16io_thread_t merged with poller_base_tMartin Sustrik
The relationship of these two classes was 1:1. Thus one of them was obsolete. Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2012-02-16ZeroMQ renamed to CrossroadsMartin Sustrik
Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2012-02-16Socket ID addedMartin Sustrik
Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2011-11-01Copyright dates adjusted to reflect realityMartin Sustrik
Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2011-10-31250bpm copyrights addedMartin Sustrik
Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2011-09-15Session class separated into socket-type-specific sessionsMartin Sustrik
This is a preliminary patch allowing for socket-type-specific functionality in the I/O thread. For example, message format can be checked asynchronously and misbehaved connections dropped straight away. Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2011-07-12Bug with setting options on SUB socket fixedMartin Sustrik
Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2011-07-11ZMQ_FILTER option removedMartin Sustrik
The filtering is now done depending on the socket type. SUB socket filters the messages (end-to-end filtering) while XSUB relies on upstream nodes to do (imprefect) filtering. Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2011-05-30Patches from sub-forward branch incorporatedMartin Sustrik
Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2011-05-28Subscription matching moved from XSUB to SUB socketMartin Sustrik
This patch will prevent duplicate matching in devices in the future. Instead of matching in both XPUB and XSUB, it'll happen only in XPUB. Receiver endpoint will still filter messages via SUB socket. Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2011-04-21Message-related functionality factored out into msg_t class.Martin Sustrik
This patch addresses serveral issues: 1. It gathers message related functionality scattered over whole codebase into a single class. 2. It makes zmq_msg_t an opaque datatype. Internals of the class don't pollute zmq.h header file. 3. zmq_msg_t size decreases from 48 to 32 bytes. That saves ~33% of memory in scenarios with large amount of small messages. Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2011-03-02The copyrights in file headers updated.Martin Sustrik
Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2011-01-07Disable sending messages on SUB socketMartin Sustrik
The ability was inherited from XSUB socket. Now it's properly disabled. Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2011-01-03sunos/gcc3 compilation issue fixedMartin Sustrik
Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2010-12-06options.type correctly set for PUB/SUB/XPUB/XSUBMartin Sustrik
Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2010-12-05XSUB accepts (un)subscriptions in form of messages.Martin Sustrik
Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2010-12-04XPUB and XSUB socket types added.Martin Sustrik
These are just placeholders. At the moment XPUB behaves th same as PUB and XSUB as SUB. Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2010-11-05slots renamed to tidsMartin Sustrik
Threads were so far identified by integers called 'slots'. This patch renames them to more comprehensible 'tid's (thread IDs). Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2010-10-30Name of "GNU Lesser Public License" corrected.Martin Sustrik
Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2010-10-16ZMQ_LINGER socket option added.Martin Sustrik
1. ZMQ_LINGER option can be set/get 2. options are part of own_t base class rather than being declared separately by individual objects 3. Linger option is propagated with "term" command so that the newest value of it is used rather than the stored old one. 4. Session sets the linger timer if needed and terminates as soon as it expires. 5. Corresponding documentation updated. Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2010-09-28ZMQ_TYPE socket option addedGonzalo Diethelm
2010-09-18single term ack counting mechanism for every socket (no separate mechanisms ↵Martin Sustrik
for fq_t and lb_t)
2010-08-25I/O object hierarchy implementedMartin Sustrik
2010-08-25WIP: Socket migration between threads, new zmq_close() semanticsMartin Sustrik
Sockets may now be migrated between OS threads; sockets may not be used by more than one thread at any time. To migrate a socket to another thread the caller must ensure that a full memory barrier is called before using the socket from the target thread. The new zmq_close() semantics implement the behaviour discussed at: http://lists.zeromq.org/pipermail/zeromq-dev/2010-July/004244.html Specifically, zmq_close() is now deterministic and while it still returns immediately, it does not discard any data that may still be queued for sending. Further, zmq_term() will now block until all outstanding data has been sent. TODO: Many bugs have been introduced, needs testing. Further, SO_LINGER or an equivalent mechanism (possibly a configurable timeout to zmq_term()) needs to be implemented.
2010-03-27ZMQ_TBC renamed to ZMQ_MOREMartin Sustrik
2010-03-27multi-part messages work with PUB/SUBMartin Sustrik
2010-03-13ZMQ_NOFLUSH and zmq_flush obsoletedMartin Sustrik
2010-03-12Implement flow controlMartin Hurton
This commit introduces the necessary changes necessary for implementing flow control. None of the socket types implements the flow control yet. The code will crash when the flow control is enabled and the thw lwm is reached. The following commits will add flow-control support for individual socket types.
2010-03-11Restructure language bindingsMartin Lucina
C and C++ headers moved from bindings/ to include/, bindings/ removed --with-c and --with-cpp options to configure removed, C and C++ now built and installed by default
2010-02-16Multi-hop REQ/REP, part XI., finalise the XREQ/XREP functionalityMartin Sustrik
2010-02-12Multi-hop REQ/REP, part III., change 'type' in options to simple ↵Martin Sustrik
'traceroute' flag
2010-02-12Multi-hop REQ/REP, part I., socket type is known to all associated objectsMartin Sustrik
2010-01-31ZMQII-51: Implement O(1) topic matchingMartin Sustrik
2010-01-13ZMQII-34: ensure that poll won't return POLLIN event when the message will ↵Martin Sustrik
be filtered out anyway (POSIX)
2010-01-05Copyrights transferred from FastMQ to iMatixMartin Sustrik
2009-12-29polling on SUB socket fixedMartin Sustrik
2009-12-28format of subscriptions changed (no * needed anymore)Martin Sustrik
2009-12-15zmq_encoder/decoder are able to add/trim prefixes from messages; fair ↵Martin Sustrik
queueing and load balancing algorithms factorised into separate classes
2009-10-01ZMQII-18: Implement I/O multiplexing (first approximation)Martin Sustrik
2009-09-23ZMQII-16: Change "struct zmq_msg_t" to "zmq_msg_t" in C bindingMartin Sustrik
2009-09-22ZMQ-specific error codes addedMartin Sustrik