XS_PLUGIN and XS_FILTER implementation

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>
Improved readability of README file.
Changed project name in README references; ignore EXE files.
Fix bogus typo in xs::pipe_t::flush()

* src/pipe.cpp (flush): Fix bogus typo: '&&' was used instead of '||'
Allow pipe_t::flush() to be called from pipe_t::terminate()

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>
Andrew W. Nosenko added to AUTHORS file

Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
Verious warnings generated by SunStudio fixed

Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
EMTHREAD error code removed

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>
tcp_address: check address length before manipulating it
Flush identity message for inproc transport

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.
Fix identity exchange for inproc transport

The socket connecting using the inproc transport never
received the identity of the remote peer.
Fix error handling in TCP and IPC connecters

Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
Handle insufficient resources on accept() decently

If accept() call fails due to insuffient OS resources
the new connection is rejected.

Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
Set CLOEXEC flag on fds used by signaler

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>
Fix /dev/poll detection on Solaris

The /dev/poll facility wasn't correctly recognized because of a missing
header. The check was fixed and overhauled in the process.

Signed-off-by: Gabriele Svelto <gabriele.svelto@gmail.com>
Fix fd/handle conversion in /dev/poll poller code

Signed-off-by: Gabriele Svelto <gabriele.svelto@gmail.com>
Fix a warning with SunStudio compiler

Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
ETIMEDOUT is a valid error code here. Fixes intermittent assertion failure on laggy networks
HANDLE_FLAG_INHERIT is set to 0 on internal sockets

On Windows, HANDLE_FLAG_INHERIT is equivalent to
O_CLOEXEC on UNIX.

Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
Accumulated cruft removed from prefix_filter_t

Signed-off-by: Martin Sustrik <sustrik@250bpm.com>