summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2012-05-13Move inclusion of select() and poll() headers to a single placeGabriele Svelto
Signed-off-by: Gabriele Svelto <gabriele.svelto@gmail.com>
2012-05-12Preparation for 1.1.0 releasev1.1.0Martin Sustrik
- version bump - ABI version bump - NEWS updated Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2012-05-12Enabled plug-in loading on all hosts with support for dlopen()Gabriele Svelto
Previously the code used for loading plug-ins would be built only on Linux hosts. Now the required functions are checked for and plug-in loading code is enabled if those are present on all platforms. Using lstat() to check for file types also increases portability to hosts that do not have the dirent.d_type field. If shared libraries support is disabled plug-ins will also be automatically disabled. Signed-off-by: Gabriele Svelto <gabriele.svelto@gmail.com>
2012-05-12Inheritance on signaler's socket on Windows switched offMartin Sustrik
Accidentally, one of the sockets in Windows signaler_t was opened usign WSASocket instead of xs::open_socket. That skipped the standard XS socket initialisation and caused the socket to be inheritable to the child processes. Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2012-05-12Fix decoder to properly handle large messagesMartin Hurton
The decoder did not properly decode large messages on systems where sizeof (size_t) < sizeof (uint64_t).
2012-05-11Command throttling breaking HWM algorithms -- fixed.Martin Sustrik
When HWM was set to small value it may have happened that command indicating that pipe is ready for writing wasn't processed because of command throttling. Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2012-05-11Improve command processing efficiencyMartin Sustrik
When processing commands with throttling switched off, RDTSC instruction was executed, but the result was never used. This patch eliminates the unneeded instruction. Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2012-05-11Fix issue #268Martin Hurton
This patch fixes a bug in the message encoder which was responsible for computing incorrect message offset. The bug affected PGM receiver making it unable to decode inital messages.
2012-05-09Build on Windows and OpenVMS fixedMartin Sustrik
On Windows and OpenVMS there is no IPC transport. This patch fixes the problem introduced by previous patches, where the fact is not taken into account. Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2012-05-09Trivial coding style fix.Martin Sustrik
Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2012-05-09Whitespace fixes in pgm_socket.cppDouglas Young
2012-05-09Return an error on invalid (e)pgm:// connectionDouglas Young
This prevents the long-standing issue of an invalid pgm or epgm connection string from causing an assert when the connection is attempted and fails.
2012-05-06C prototype for xs_init fixedMartin Sustrik
The function was erroneously declared as xs_init() instead of xs_init(void). Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2012-05-06Douglas Young added to the AUTHORS fileMartin Sustrik
Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2012-05-06Return error if an invalid connection string is usedDouglas Young
This patch reintroduces the behaviour that if a tcp:// or ipc:// connection string which is invalid is passed to xs_connect, then an error is reported, instead of asserting at connection time
2012-05-04Test for backlog exhaustion addedMartin Sustrik
Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2012-05-04Correct handling of connect() errors in tcp, ipc_connecter_tMartin Lucina
EAGAIN was being used as a translation value for EINPROGRESS, thus shadowing a real EAGAIN return value from the OS. This caused later assertions of "Invalid argument" in stream_engine.cpp when it attempted to use a socket which was not connected. I also add EINTR to mean EINPROGRESS, as per the POSIX and FreeBSD documentation which specifies that a connect() call interrupted due to a signal will complete asynchronously. Signed-off-by: Martin Lucina <martin@lucina.net>
2012-05-02Conditionally include header files required by select() and poll()Gabriele Svelto
Feature checks are introduced to check for all the headers required by the select() and poll() calls. Include files are then included conditionally without the use of any OS-specific directive. The change also fixes a couple of problems: - Fixed compilation under FreeBSD, NetBSD and OpenBSD when forcing the use of select() in the poller - Quieted a warning mixed-sign comparison warning on FreeBSD caused by FD_SETSIZE being declared as an unsigned constant on that OS - Removed the obsolescent AC_HEADER_TIME macro from the configure script Signed-off-by: Gabriele Svelto <gabriele.svelto@gmail.com>
2012-05-01Revert "Implement protocol versioning (except PGM)"Martin Sustrik
This reverts commit 512f3a604924fec9d89e2b4bfd6f73aa66309fa7.
2012-04-30'own' command replaced by synchronous callMartin Sustrik
The commands was a vestige of the removed 'durable sockets' feature Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2012-04-30Fix premature poll reset_polloutPaul Colomiets
Signed-off-by: Paul Colomiets <paul@colomiets.name>
2012-04-29Leftover references to ZMQ removed from xs_setsockopt(3) man pageMartin Sustrik
Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
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-29Fix TCP/IPC socket shutdownMartin Sustrik
When socket in the process of asynchronous connect is being closed and the fact that there is no peer is found out at the same time close() may return ECONNRESET. This patch handles this situation decently. Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2012-04-29Ian Barber moved from Credits to Authors sectionMartin Sustrik
Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2012-04-29Refine documentation for XS_FD optionIan Barber
2012-04-29Patrick Trantham added to the AUTHORS fileMartin Sustrik
Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2012-04-29atomic: prever inline asm over GCC builtins for armv7aAndrew W. Nosenko
As per Patrick Trantham comment http://groups.crossroads.io/r/topic/510xaadGgWVcXFdATnhAuN the GCC __sync_*() builtins are more generic but slower than specialized hand-written assembly for armv7a case. Therefore, the code is reordered for prefer inline assembly for armv7a over GCC builtins. * src/atomic_counter.hpp: (atomic_counter_t::add): (atomic_counter_t::sub): * src/atomic_ptr.hpp: (atomic_ptr_t::xchg): (atomic_ptr_t::cas): Prefer armv7a specific inline asm over GCC __sync_*() builtins.
2012-04-29atomic: revisit the atomic operation checks and their usageAndrew W. Nosenko
* configure.ac: Check for working Solaris/NetBSD-style atomic.h independly on OS. Add check for GCC-style __sync_*() builtins. New defines: XS_ATOMIC_GCC_SYNC, XS_ATOMIC_SOLARIS. Removed define: XS_FORCE_MUTEXES. * src/atomic_counter.hpp: (atomic_counter_t::add): (atomic_counter_t::sub): * src/atomic_ptr.hpp: (atomic_ptr_t::xchg): (atomic_ptr_t::cas): Use result of these checks. Preference order: 1. GCC-style __sync_*() builtins 2. Inline asm (x86, x86-64, armv7a) 3. Solaris/NetBSD-style atomic.h, Windows-specific API 4. Fallback to mutex-based implementation
2012-04-29atomic: prefer GCC __sync_*() builtins over inline asmAndrew W. Nosenko
Use GCC __sync_*() builtins when compiler claims to be GCC (GCC itself, Clang...) It can be disabled explicitly by using XS_DISABLE_GCC_SYNC_BUILTINS define. Just for any case. * src/atomic_counter.hpp [__GNUC__ && !XS_DISABLE_GCC_SYNC_BUILTINS]: (atomic_counter_t::add): (atomic_counter_t::sub): * src/atomic_ptr.hpp [__GNUC__ && !XS_DISABLE_GCC_SYNC_BUILTINS]: (atomic_ptr_t::xchg): (atomic_ptr_t::cas): Prefer GCC __sync_*() builtins over inline asm.
2012-04-29Implement atomic operations for armv7aPatrick Trantham
This commit implements atomic operations for the armv7a architecture using gcc inline assembly. This offers higher performance compared to pthread mutexes. Tested on an am3517 evm, clocked at 600MHz: ./inproc_thr 200 1000000 ------------------------ 53-60K messages / sec, pthread mutexes 73-90K messages / sec, assembly atomic ops ./inproc_lat 200 1000000 ------------------------ average latency: 42.234 [us], pthread mutexes average latency: 35.496 [us], assembly atomic ops
2012-04-29Fix a bug in prefix filter compaction logicAdam Guthrie
2012-04-27Replaced obsolete autoconf and automake macrosGabriele Svelto
This patch cleans up a number of obsolete constructs in the build system, these include: - Replacing AC_TRY_RUN with AC_RUN_IFELSE for the SOCK_CLOEXEC test - Using AC_CONFIG_HEADERS instead of AM_CONFIG_HEADER - Using LT_INIT with the win32-dll parameter instead of the obsolete AC_PROG_LIBTOOL and AC_LIBTOOL_WIN32_DLL macros - Removing the unused and obsolete AC_TYPE_SIGNAL check - Removing the unused alloca.h header check - Replacing the deprecated INCLUDES macro with AM_CPPFLAGS Signed-off-by: Gabriele Svelto <gabriele.svelto@gmail.com>
2012-04-27Truncate the message when it is sent to XSUBMartin Sustrik
This patch is based on patch by Martin Hurton from 0MQ project. Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2012-04-25Solaris build fixedMartin Sustrik
Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2012-04-25tcp_address_t and ipc_address_t merged into a single classMartin Sustrik
This patch is a preliminary work for mergine TCP and IPC connecters and listeners. The ultimated goal is to avoid code duplication occuring in these classes. Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2012-04-22Initialise fd_set once for signler_t objectMartin Sustrik
Optimisation. Up to now new fd_set was initialised in each signaler_wait call. Now the fd_set is initialised once when signaler is created. This is useful espacially on Windows where fd_set is list of pointers rather than bitset and thus can be rather large. Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2012-04-21Select polling mechanisms at one placeMartin Sustrik
This patch provides a single place for selecting polling mechanisms (polling.hpp). Up to now the selection was spread among the build system and several source files. Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2012-04-21Change the way the polling system is selectedGabriele Svelto
All polling systems are now checked and corresponding macros set accordingly (e.g. detection of a working poll() function will define XS_HAVE_POLL). Additionally if the user selects a specific polling system via the --with-poller switch a corresponding XS_FORCE_* macro will be defined. The select() and poll() tests now conditionally include headers which makes them more robust on various target platforms. Signed-off-by: Gabriele Svelto <gabriele.svelto@gmail.com>
2012-04-21Documentation for survey pattern addedMartin Sustrik
Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2012-04-21Fix a warning in MSVC buildMartin Sustrik
Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2012-04-21Minor typo in tests.cpp fixedMartin Sustrik
Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2012-04-21xs_shutdown implementedMartin Sustrik
This patch allows for partial shutdown of the socket. Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2012-04-20Footnotes in README fixedMartin Sustrik
It turns out the GitHub is not able to format Asciidoc footnotes. This patch handles the footnotes manually. Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2012-04-20Clock instance removed from surveyor_tMartin Sustrik
SURVEYOR socket now uses clock instance from socket_base_t for measuring survey timeout. This allows for better performance in tight xs_recv() loops. Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2012-04-18Adam Guthrie added to the AUTHORS fileMartin Sustrik
Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2012-04-18xs_zmq: initialize size in zmq_getsockoptAdam Guthrie
This fixes a critical bug in zmq_getsockopt.
2012-04-18Improve efficiency of time measurement in tight loopsMartin Sustrik
This patch instantiate a clock_t instance for each XS socket. Thus, it is shared between subsequent calls to xs_recv (and xs_send). That in turn significantly limits the number of invocations of getimeofday (or similar) when timeouts are used and recv/send is called in a tight loop. Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2012-04-18Test that old surveys are discardedMartin Sustrik
Improvement to the "survey" test Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2012-04-18Discard pending surveys when (X)SURVEYOR socket disappearsMartin Sustrik
This is an optimisation. The idea is that when surveyor disappears it makes no sense to process any surveys it have sent. There are two cases handled: - when (X)SURVEYOR socket is closed any unsent outbound messages are discarded - when (X)RESPONDENT detects that its peer have disconnected it drops any unprocessed messages that have been received from it Signed-off-by: Martin Sustrik <sustrik@250bpm.com>