Age | Commit message (Collapse) | Author |
|
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>
|
|
This reverts commit 512f3a604924fec9d89e2b4bfd6f73aa66309fa7.
|
|
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>
|
|
- couple of comments adjusted
- empty 'stack delimiter' message correctly closed
- non-reachable function xrep_t::rollback() removed
Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
|
|
Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
|
|
Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
|
|
The relationship of these two classes was 1:1.
Thus one of them was obsolete.
Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
|
|
With the introduction of subscription forwarding, the first message
sent on a PUB socket using a unidirectional transport (e.g. PGM) is
always lost due to the "subscribe to all" being done asynchronously.
This patch fixes the problem and also refactors the code to have a
single point where the "subscribe to all" is performed.
Signed-off-by: Martin Lucina <martin@lucina.net>
|
|
Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
|
|
Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
|
|
Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
|
|
Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
|
|
However, the "durable socket" behaviour wasn't re-added.
Identities are used solely for routing in REQ/REP pattern.
Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
|
|
Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
|
|
Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
|
|
Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
|
|
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>
|
|
This patch simplifies the whole codebase significantly,
including dropping depedency on libuuid.
Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
|
|
So far the requests in req/rep pattern were delivered to and processed
by worker even though the original requester was dead. Thus,
the worker processing replies with noone to deliver results to.
This optimisation drops requests in two situations:
1. Queued inbound requests in XREP socket when peer disconnects.
2. Queued outbound requests in XREQ when socket is closed.
Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
|
|
So far, the pipe termination code was spread among socket type
classes, fair queuer, load balancer, etc. This patch moves
all the associated logic to a single place.
Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
|
|
So far, there was a pair of unidirectional pipes between a socket
and a session (or an inproc peer). This resulted in complex
problems with half-closed states and tracking which inpipe
corresponds to which outpipe.
This patch doesn't add any functionality in itself, but is
essential for further work on features like subscription
forwarding.
Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
|
|
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>
|
|
Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
|
|
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>
|
|
Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
|
|
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>
|
|
|
|
for fq_t and lb_t)
|
|
|
|
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.
|
|
This reverts part of commit 84e0c7991a9b316ed571533abc628cc1175750a3 to get
correct ZMQ_HWM semantics with XREQ sockets:
When sending a message to an XREQ socket, the underlying pipe is selected in
a round-robin fashion. If an underlying pipe is full it is skipped. If there
are no underlying pipes, or all underlying pipes are full then zmq_send()
shall block or return EAGAIN, depending on whether or not the call is blocking.
Messages are never dropped.
|
|
|
|
|
|
|
|
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.
|
|
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
|
|
|
|
'traceroute' flag
|
|
|
|
|
|
queueing and load balancing algorithms factorised into separate classes
|
|
|
|
|