Commit Graph

57 Commits

Author SHA1 Message Date
Martin Hurton
084e8792de Small cleanup in pipe.cpp 2013-06-22 16:15:35 +02:00
Martin Hurton
c3e40736de Rename terminated->pipe_terminated 2013-06-06 13:28:21 +02:00
Martin Hurton
4e4803e07f Rename pipe states to make it more mnemonic 2013-05-28 13:45:20 +02:00
Pieter Hintjens
f0f16505e5 Removed corporate advertisements from source file headers
Copyrights had become ads for Sustrik's corporate sponsors, going against the original
agreement to share copyrights with the community (that agreement was: one line stating
iMatix copyright + one reference to AUTHORS file). The proliferation of corporate ads
is also unfair to the many individual authors. I've removed ALL corporate title from
the source files so the copyright statements can now be centralized in AUTHORS and
source files can be properly updated on an annual basis.
2013-03-12 13:24:57 +01:00
Martin Hurton
6f47f1281b Do not pass a message to the check_write method
The check_write method does not use the passed message.
The parameter was needed to implement the swap.
As the swap is not supported anymore, it is safe to remove this parameter.
2012-03-28 07:28:42 +02:00
AJ Lewis
c79abee6bc Get AIX 6.1 compiling again by making msg_t class explicit
Older versions of gcc have problems with in-line forward declarations
when there's a naming conflict with a global symbol.

Signed-off-by: AJ Lewis <aj.lewis@quantum.com>

Expand the original patch to all such forward declarations.
Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2011-11-09 15:22:20 +01:00
Martin Sustrik
a4843b65d2 Identities re-introduced
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>
2011-11-04 08:00:47 +01:00
Martin Sustrik
8e21d64c97 Copyright dates adjusted to reflect reality
Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2011-11-01 18:06:11 +01:00
Martin Sustrik
ac7717b7b3 250bpm copyrights added
Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2011-10-31 16:20:30 +01:00
Martin Sustrik
d1373792f7 Outstanding requests dropped when requester dies (issue 190)
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>
2011-06-23 07:57:47 +02:00
Martin Sustrik
12532c7940 O(1) fair-queueing in XREP implemented
Up to now the complexity of fair-queueing in XREP was O(n).

Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2011-06-22 16:51:40 +02:00
Martin Sustrik
a24a7c15a8 Session termination induced by socket fixed
Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2011-05-31 14:36:51 +02:00
Martin Sustrik
0b59866a84 Patches from sub-forward branch incorporated
Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2011-05-30 10:07:34 +02:00
Martin Sustrik
87a6490b39 All pipe termination code moved to pipe_t
Till now the code was spread over mutliple locations.
Additionally, the code was made more formally correct,
with explicit pipe state machine etc.

Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2011-05-25 10:25:51 +02:00
Fabien Ninoles
71ac91ba41 Add multi-array support to array_item_t.
Allow to have the same item part of two different arrays, as long as
they are using different array identifier.
2011-05-23 21:36:00 +02:00
Martin Sustrik
acf0b0e515 Introduces bi-directional pipes
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>
2011-05-22 17:26:53 +02:00
Martin Sustrik
e0246e32d7 Message-related functionality factored out into msg_t class.
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-04-21 22:27:48 +02:00
Martin Sustrik
507718ee1a ZMQ_HWM type changed to int
Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2011-03-24 15:43:03 +01:00
Martin Sustrik
8463b4d55e SWAP functionality removed
On-disk storage should be implemented in devices rather than
in 0MQ core. 0MQ is a networking library and there's no point
in storing network buffers on disk.

Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2011-03-24 12:27:06 +01:00
Martin Sustrik
18b9ebea32 The copyrights in file headers updated.
Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2011-03-02 16:30:40 +01:00
Martin Sustrik
18f29ded6a Make cppcheck not complain about "'operator=' should return something"
Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2011-01-13 11:44:23 +01:00
Mikko Koppanen
27e83cc525 Fixes assertion on pipe.cpp:237 when swap fills up.
Fixes swap::full () functionality

Signed-off-by: Mikko Koppanen <mkoppanen@php.net>
2010-12-15 20:10:27 +01:00
Martin Sustrik
b358df9fff Name of "GNU Lesser Public License" corrected.
Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2010-10-30 15:08:28 +02:00
Martin Sustrik
733c6780c5 Minor code clean-up to keep clang compiler happy.
"warning: extra ';' inside a struct or union [-pedantic]"

Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2010-10-16 01:22:18 +02:00
Mikko Koppanen
e33e4d7650 ICC related qualifier fix
Signed-off-by: Mikko Koppanen <mkoppanen@php.net>
2010-10-15 10:38:09 +02:00
Martin Sustrik
7a685b0f88 Clean-up of session termination process
Specifically, shutdown of child objects is initiated *before* termination
handshake with socket object.

Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2010-10-08 17:23:21 +02:00
Martin Sustrik
f374431ebe get rid of 'has virtual functions but non-virtual destructor' warnings in pipe.hpp 2010-09-07 17:06:33 +02:00
Martin Sustrik
090e460d6f naming cleanup: yarray->array 2010-08-31 21:03:34 +02:00
Martin Sustrik
d8b975f4e7 msg_store_t renamed to swap_t 2010-08-28 13:14:45 +02:00
Martin Sustrik
d90b407115 refactoring of pipe/swap interaction 2010-08-28 13:06:58 +02:00
Martin Sustrik
42000d2c4f terminology unified: revive->activate 2010-08-28 10:15:03 +02:00
Martin Sustrik
b608c19c5a MSVC build fixed 2010-08-25 15:39:21 +02:00
Martin Sustrik
f77edfce26 Destruction of session is delayed till both in & out pipes are closed 2010-08-25 15:39:20 +02:00
Martin Sustrik
05d908492d WIP: Socket migration between threads, new zmq_close() semantics
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-08-25 15:39:20 +02:00
Martin Hurton
10533a560b pipe: check_read() should check for message delimiter 2010-07-24 17:33:54 +02:00
Martin Hurton
fca2e8e8cc Add SWAP support 2010-06-21 15:06:51 +02:00
Martin Sustrik
8408ae066d LWM is computed rather than explicitly specified by user 2010-05-25 15:03:57 +02:00
Martin Sustrik
235ed3a3dc signaler transports commands per se rather than one-bit signals 2010-05-04 10:22:16 +02:00
Martin Sustrik
c42343d3f0 pipe_t::rollback removes only unfinished message from the pipe rather than all unflushed messages 2010-03-13 12:34:55 +01:00
Martin Hurton
61ee6fae53 Implement flow control
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-12 11:07:38 +01:00
Martin Lucina
27e2d08449 Restructure language bindings
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-03-11 20:33:27 +01:00
Martin Sustrik
e04e2cdbba rollback functionality added to pipe 2010-03-09 08:43:20 +01:00
Martin Sustrik
4f6baf4dde Copyrights transferred from FastMQ to iMatix 2010-01-05 08:29:35 +01:00
unknown
0d704fceee MSVC warnings fixed 2009-12-01 14:58:00 +01:00
Martin Sustrik
f2ff2c6e5c checking for available messages added to ypipe/pipe 2009-09-30 10:08:35 +02:00
Martin Sustrik
088a2db674 ZMQII-16: Change "struct zmq_msg_t" to "zmq_msg_t" in C binding 2009-09-23 10:22:54 +02:00
Martin Sustrik
cb1b6fe32c initial version of req/rep sockets 2009-09-21 14:39:59 +02:00
malosek
1b2a426656 c and cpp directories moved into bindings directory 2009-09-16 16:49:09 +02:00
malosek
b71c3005e6 include directory split into c and cpp dirs, added --with-c and --with-cpp configure options 2009-09-07 17:06:47 +02:00
Martin Sustrik
cb09c6951e pipe deallocation added 2009-08-28 16:51:46 +02:00