Age | Commit message (Collapse) | Author |
|
thread_t is one of the classes where C++ syntax creates more
problems then it solves. This patch converts it into simple
C-style pseudo-class.
Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
|
|
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>
|
|
Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
|
|
This patch propoagates the error from signaler and mailbox
initialisation up the stack.
To achieve this signaler and mailbox classes were re-written
is C-like syntax.
Finally, shutdown_stress test now ignores EMFILE/ENFILE errors.
Thus, the tests should pass even on OSX which sets the max
number of file descriptors pretty low by default.
Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
|
|
- 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>
|
|
* src/stream_engine.cpp (stream_engine_t::stream_engine_t):
Use
#ifdef SO_NOSIGPIPE
instead of
#if defined XS_HAVE_OSX || defined XS_HAVE_FREEBSD
|
|
Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
|
|
This patch consolidates the up-to-now scattered code that
sets different options on newly created sockets.
There are open_socket and open_tcp_socket functions that
do the tuning automatically.
In case the socket is not created but got from elsewhere
(such as accept() call) there are tune_socket and tune_tcp_socket
functions that will do the tuning.
Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
|
|
Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
|
|
Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
|
|
On Windows, HANDLE_FLAG_INHERIT is equivalent to
O_CLOEXEC on UNIX.
Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
|
|
on laggy networks
|
|
Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
|
|
Signed-off-by: Gabriele Svelto <gabriele.svelto@gmail.com>
|
|
While TCP and IPC socket duplicates are correctly closed on
fork+exec, file descriptors used for internal communication
within libxs are not. This patch fixes the problem.
Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
|
|
If accept() call fails due to insuffient OS resources
the new connection is rejected.
Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
|
|
Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
|
|
The socket connecting using the inproc transport never
received the identity of the remote peer.
|
|
The scoket implementation for inproc transfer failed to flush
identity message. The result was that the identity message
was not delivered until after the user sent the first message.
The identity message was never delivered if the user
used the socket only to receive messages.
|
|
|
|
libxs (as opposed to libzmq) requires at least one I/O thread per
context. Thus, "no I/O thread available" error doesn't make sense
anyome.
This patch removes the code and the documentation.
It keeps the definition of EMTHREAD itself for backward compatibility.
Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
|
|
Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
|
|
Previous patch have broken flushing a delimiter in pipe_t::terminate()
function. This patch allows the flush to happen even if pipe state
is set to 'terminated'.
Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
|
|
* src/pipe.cpp (flush): Fix bogus typo: '&&' was used instead of '||'
|
|
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>
|
|
Although not a POSIX behaviour, FreeBSD can fail with ECONNRESET.
Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
|
|
- XS_PROTOCOL option added
- libxs ignores when unused flags are set to 1 (0MQ/2.1 bug)
- compatibility tests added
Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
|
|
This option allows to turn on TCP keepalives on the underlying connections.
Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
|
|
When connection with duplicate identity arrives it is ignored.
Till now it resulted in assertion.
Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
|
|
Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
|
|
|
|
|
|
Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
|
|
Error handling of asynchronous connect for IPC was incorrectly copied
from TCP transport. This patch fixes the problem.
Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
|
|
On reconnections, state machine in req_session_t is
reset to the initial state.
Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
|
|
When reconnection happened, identity was not resent to the peer.
Fixed.
Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
|
|
Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
|
|
Signed-off-by: Piotr Sikora <piotr.sikora@frickle.com>
|
|
Signed-off-by: Piotr Sikora <piotr.sikora@frickle.com>
|
|
Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
|
|
Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
|
|
Originally, the parameter was of type long which is incompatible
with POSIX poll() function.
Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
|
|
Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
|
|
Moved xs_stopwatch_* functions from xs_utils.cpp/xs_utils.h, and
removed those files. This leaves us with a single header file for
libxs.
Signed-off-by: Martin Lucina <martin@lucina.net>
|
|
Reduced xs_utils to the minimum functions required (xs_stopwatch_*)
xs_sleep, xs_thread_* are internal to unit tests and have been moved
to testutil.hpp, useless use of xs_sleep in perf/ has been removed.
Signed-off-by: Martin Lucina <martin@lucina.net>
|
|
|
|
This simplifies the options for new users; either use libxs APIs or build
with --enable-libzmq and get libzmq 2.1 emulation.
Signed-off-by: Martin Lucina <martin@lucina.net>
|
|
The argument was changed to a context option (XS_IO_THREADS).
0MQ compatibility mode sets the option and ensures that
there's at least one I/O thread present.
Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
|
|
Check if the constant is defined before using it. While the constant may
be defined on FreeBSD, there's no support for the functionality and
specifying the flag may cause errors.
Signed-off-by: Gabriele Svelto <gabriele.svelto@gmail.com>
|
|
Removing the pipe may have caused problems with matching,
active and eligible pipes. Some pipes may have moved from one
category to another without any reason.
Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
|