Commit Graph

63 Commits

Author SHA1 Message Date
Martin Hurton
414fc86b22 Code cleanup
- limit visibility of pending_connection_t
- add const qualifiers
2014-05-21 13:08:15 +02:00
Martin Hurton
a80fb34765 Fix some comments regarding method overriding 2014-01-08 18:29:35 +01:00
Pieter Hintjens
b3b9e046ee Updated copyright statements for 2014 2014-01-02 12:00:57 +01:00
Richard Newton
7841b0dd0f Support high water mark on inproc socket connect before bind. 2013-09-14 17:27:18 +01:00
Richard Newton
379bcb0881 Send identities when connecting pending sockets. 2013-09-12 21:07:29 +01:00
Richard Newton
7c3496a76a Fix race condition and support multiple socket connects before bind. 2013-09-12 18:09:37 +01:00
Richard Newton
5f20d63665 First attempt at inproc connect before bind 2013-09-12 14:44:44 +01: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
Ian Barber
81b8362a59 Revert "Fix a number of whitespace issues in various parts of the code, add validation to most calls on the test and take a first stab at implementing the reconnection pipe blocking."
This reverts commit 6f6466f088.
2012-06-12 14:51:50 +01:00
Ian Barber
f0920caf02 Revert "On the advice of Martin Hurton, removed the new command type and just terminated the pipe in a reconnect situation, and notified the socket of the same. This handles the blocking properly, but at the cost of potentially losing in flight messages. However, this is a reasonable trade off given how much simpler it makes the patch."
This reverts commit c13f1d52ff.
2012-06-12 14:50:50 +01:00
Ian Barber
c13f1d52ff On the advice of Martin Hurton, removed the new command type and just terminated the pipe in a reconnect situation, and notified the socket of the same. This handles the blocking properly, but at the cost of potentially losing in flight messages. However, this is a reasonable trade off given how much simpler it makes the patch. 2012-06-04 10:27:16 +01:00
Ian Barber
6f6466f088 Fix a number of whitespace issues in various parts of the code, add validation to most calls on the test and take a first stab at implementing the reconnection pipe blocking.
It didn't seem straightforward to use any of the existing process calls, so I have added a new command to command_t and friends called detach. This instructs the socket_base to remove the pipe from it's pipe list. The session base stores a copy of the outpipe, and will resend the bind command on reconnection. This should allow balancing again.
2012-06-03 22:57:47 +01: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
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
f78d9b6bfc Session class separated into socket-type-specific sessions
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>
2011-09-15 10:00:23 +02:00
Martin Sustrik
c8e8f2a24c ZMQ_IDENTITY socket option removed
This patch simplifies the whole codebase significantly,
including dropping depedency on libuuid.

Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2011-07-15 11:24:33 +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
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
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
17e2ca71b4 Logging of duplicit identities added
Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2011-02-18 14:15:10 +01:00
Martin Sustrik
5b82b1ba30 Reaper thread waits for commands rather them retrieving them periodically
Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2011-02-09 22:23:21 +01:00
Martin Sustrik
80ac398bba Initial implementation of reaper thread.
Reaper thread destroys the socket asynchronously.
zmq_term() can be interrupted by a signal (EINTR).
zmq_socket() will return ETERM after zmq_term() was called.

Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2011-02-09 15:32:15 +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
Martin Sustrik
bd0ba6e89a Size of inproc hwm and swap is sum of peers' hwms and swaps
The meat of the patch was contributed by Douglas Creager.
Martin Sustrik implemented storing peer options in inproc
endpoint repository.

Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2011-01-10 13:53:30 +01:00
Martin Sustrik
9cfdb441f4 slots renamed to tids
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>
2010-11-05 16:38:52 +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
0a03e86e95 ZMQ_LINGER socket option added.
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>
2010-10-16 10:53:29 +02:00
Martin Sustrik
a68e6739f4 when no I/O threads are available error is raised instead of assertion 2010-09-09 08:25:00 +02:00
Martin Sustrik
ce0972dca3 context creates an inproc endpoint ('inproc://log') to distribute 0MQ's log messages 2010-09-01 07:57:38 +02:00
Martin Sustrik
42000d2c4f terminology unified: revive->activate 2010-08-28 10:15:03 +02:00
Martin Sustrik
45f83d78a5 one more dezombification bug fixed 2010-08-25 15:39:20 +02:00
Martin Sustrik
936dbf956b dezombification procedure fixed 2010-08-25 15:39:20 +02:00
Martin Sustrik
d13933bc62 I/O object hierarchy implemented 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 Sustrik
835e893e54 dispatcher_t class renamed to ctx_t 2010-05-05 14:24:54 +02:00
Martin Sustrik
8b9bd05726 thread ID and dispatcher made private in object_t 2010-05-03 16:21:36 +02:00
Martin Sustrik
ae93ed318a signaler rewritten in such a way that any number (>64) of threads can be used 2010-04-29 20:34:48 +02: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 Sustrik
4405250d93 Multi-hop REQ/REP, part IX., pass the peer identity as far as socket_base_t 2010-02-13 15:30:03 +01:00
Martin Sustrik
f5ce81f289 Multi-hop REQ/REP, part VIII., new blob_t type used for holding identity 2010-02-13 14:07:30 +01:00
Martin Sustrik
2e78e48503 Multi-hop REQ/REP, part V., peer identity is passed from init object to session 2010-02-12 20:49:00 +01:00
Martin Sustrik
4f6baf4dde Copyrights transferred from FastMQ to iMatix 2010-01-05 08:29:35 +01:00
Martin Sustrik
7cf18a2aec minor fixes 2009-12-21 20:45:52 +01:00
Martin Sustrik
2cef05d869 reconnection mechanism added to tcp transport 2009-12-15 17:49:40 +01:00
Martin Sustrik
7146ef85e9 seqnum mechanism automated 2009-12-02 21:26:47 +01:00
Martin Sustrik
9bd309bda6 annoying optimisation in 'bind' command removed 2009-12-01 18:50:54 +01:00
Martin Sustrik
c41daca3da race condition in inproc transport shutdown fixed 2009-11-21 21:30:09 +01:00
Martin Sustrik
64634605b3 obsolete parameter removed from 'bind' command 2009-11-21 21:13:29 +01:00