Martin Sustrik
ec81f8fb25
New wire format for REQ/REP pattern
...
This patch introduces two changes:
1. 32-bit ID is used to identify the peer instead of UUID
2. REQ socket seeds the label stack with unique 32-bit request ID
It also drops any replies with non-matching request ID
Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2011-06-22 11:02:16 +02:00
Martin Sustrik
10a93bb79f
Unspecified error code from mailbox_t::recv on Win32 fixed
...
Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2011-06-21 13:44:44 +02:00
Martin Sustrik
a28928fe37
Introduce ZMQ_ROUTER and ZMQ_DEALER sockets
...
Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2011-06-20 13:36:18 +02:00
Martin Sustrik
f437c9ed9b
Fix errors in zmq_getsockopt(3) manpage
...
Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2011-06-20 12:27:56 +02:00
Martin Sustrik
ab99975ad4
LABEL flag added to the wire format
...
So far there was no distinction between message parts used by 0MQ
and message parts used by user. Now, the message parts used by 0MQ
are marked as 'LABEL'.
Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2011-06-20 11:33:54 +02:00
Martin Sustrik
ada5d42472
Basic tests now test multi-part messages instead of single-part
...
Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2011-06-20 11:16:10 +02:00
Martin Sustrik
c80908c469
Bug fixed in pipe termination
...
Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2011-06-20 08:21:00 +02:00
Fabien Ninoles
7572fee979
Optimise block/non-block switching in mailbox_t
...
For the platforms that don't support MSG_DONTWAIT the reader
socket in mailbox_t was kept in non-blocking state and flipped
to blocking state and back when blocking read was requested.
Now, the state is preserved between calls and flipped only
if different type of operation (block vs. non-block) is
requested.
Signed-off-by: Fabien Ninoles <fabien@tzone.org>
Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2011-06-20 08:14:21 +02:00
Martin Sustrik
8440de2b14
Fix minor warning in MSVC build
...
Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2011-06-20 08:11:48 +02:00
Martin Sustrik
f4760f02c3
Disable timeo test on MinGW
...
Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2011-06-20 07:35:24 +02:00
Martin Sustrik
082f8e19b7
Mailbox timeouts fixed on Windows
...
Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2011-06-19 19:08:48 +02:00
Martin Sustrik
ed680a395e
Documentation for XPUB and XSUB socket added
...
Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2011-06-19 16:39:27 +02:00
Martin Sustrik
9f4d3767fe
Session termination error fixed
...
When session is already terminating and reconnection happens at
that point, the session should not create new pipe to its socket.
Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2011-06-19 12:48:36 +02:00
Martin Sustrik
00dc0245e6
Race condition in pipe_t fixed.
...
pipe_t now correctly drops pointer to the underlying pipe when
sending pipe_term_ack command.
Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2011-06-19 11:17:20 +02:00
Martin Sustrik
6052709c2a
ENETDOWN is a legal error from TCP connect
...
Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2011-06-19 09:33:01 +02:00
Martin Sustrik
5b77a41eaf
Throughput tests fixed.
...
Introduction of subscription forwarding have broken throughput tests.
This patch changes the pattern used in the tests to PUSH/PULL.
Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2011-06-19 09:22:11 +02:00
Martin Sustrik
4b60023b96
Merge branch 'master' of github.com:zeromq/libzmq
2011-06-19 09:15:06 +02:00
Steven McCoy
9b795de4af
Refactor Windows versioning and WinSock usage.Signed-off-by: Steven McCoy <steven.mccoy@miru.hk>
2011-06-18 20:44:03 +02:00
Martin Sustrik
dc66053530
Minor MSVC warning fixed
...
Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2011-06-18 20:41:21 +02:00
Fabien Ninoles
d7923f08ca
Add sockopt ZMQ_RCVTIMEO/ZMQ_SNDTIMEO.
...
- Add doc and tests
- Add options and setup
- Wait using poll/select
Signed-off-by: Fabien Ninoles <fabien@tzone.org>
Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2011-06-17 12:22:02 +02:00
Martin Sustrik
e895607ca7
ENETUNREACH is a valid error from connect
...
This patch fixed the JIRA issue 223
Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2011-06-14 09:58:18 +02:00
Martin Sustrik
65d2b70312
Minor patch to fix ICC build
...
Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2011-06-13 08:15:05 +02:00
Martin Sustrik
970798ff98
mtrie.cpp added to MSVC build
...
Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2011-06-13 07:54:58 +02:00
Martin Sustrik
c7fb5c54b6
Reverting previous commit that broke MSVC2010 build
...
Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2011-06-13 07:53:22 +02:00
Steven McCoy
b164023cca
Fix scope on Windows includes.
...
Fix windows.h included before winsock2.h.
Remove definition of _WINSOCKAPI_.
Signed-off-by: Steven McCoy <steven.mccoy@miru.hk>
2011-06-12 19:37:11 +02:00
Martin Sustrik
ff93f54653
ZMQ_FILTER socket option added
...
This option is a performance tweak. In devices XSUB socket filters
the messages just to send them to XPUB socket which filters them
once more. Setting ZMQ_FILTER option to 0 allows to switch the
filtering in XSUB socket off.
Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2011-06-12 15:24:08 +02:00
Martin Sustrik
e080e3e8b6
Publisher-side filtering for multi-part messages fixed
...
Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2011-06-12 10:19:21 +02:00
Martin Sustrik
bd86def1c7
Actual message filtering happens in XPUB socket
...
Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2011-06-11 20:29:56 +02:00
Martin Sustrik
3935258b82
Minor code beautification for mtrie_t
...
Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2011-06-01 11:54:33 +02:00
Martin Sustrik
ee7313b4d8
Subscriptions are processed immediately in XPUB socket
...
Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2011-05-31 16:21:17 +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
311fb0d852
Subscription matching moved from XSUB to SUB socket
...
This patch will prevent duplicate matching in devices in the future.
Instead of matching in both XPUB and XSUB, it'll happen only
in XPUB. Receiver endpoint will still filter messages via SUB
socket.
Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2011-05-28 09:02:21 +02:00
Martin Sustrik
718885fdcd
Pending messages are delivered even if connection doesn't exist yet
...
Bug in previous refactoring fixed.
Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2011-05-26 11:30:25 +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
Martin Sustrik
3d4203decf
Fabien Ninoles added to the AUTHORS file
...
Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2011-05-23 21:37:52 +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
0f6f7276e3
Move the pipe termination code to socket_base_t
...
So far, the pipe termination code was spread among socket type
classes, fair queuer, load balancer, etc. This patch moves
all the associated logic to a single place.
Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2011-05-23 20:30:01 +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
9e6b399256
Couple of minor issues in MSVC build fixed
...
Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2011-05-17 14:27:03 +02:00
Martin Sustrik
da7b6d0b38
Paul Colomiets added to AUTHORS file
...
Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2011-05-17 10:13:54 +02:00
Paul Colomiets
38e5f8699c
Better handling of memory error in resolve_ip_hostname
...
Signed-off-by: Paul Colomiets <pc@gafol.net>
2011-05-17 10:12:27 +02:00
Paul Colomiets
864c18f797
zmq_msg_init_data returns ERRNO instead aborting
...
Signed-off-by: Paul Colomiets <pc@gafol.net>
2011-05-17 10:09:04 +02:00
Martin Sustrik
d8d5a627b1
Duplicate initialisation of PGM_MULTICAST_HOPS removed
...
Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2011-05-16 10:44:38 +02:00
Martin Sustrik
5d0cffc52f
ZMQ_MULTICAST_HOPS socket option added
...
Sets the time-to-live field in every multicast packet sent from the socket.
Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2011-05-15 18:25:43 +02:00
Martin Sustrik
49df2f416c
Fixes warning when compiling with MSVC on Win64
...
Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2011-05-15 13:12:09 +02:00
Martin Sustrik
49387874ef
Async connect doesn't fail on EWSANETDOWN
...
Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2011-05-08 09:03:49 +02:00
Pieter Hintjens
da1ef4d268
Fixed REP assert on missing envelope
...
Signed-off-by: Pieter Hintjens <ph@imatix.com>
2011-05-08 09:02:47 +02:00
Martin Sustrik
0c5b781e97
urrent pipe pointer in XREP out of range -- fixed.
...
Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2011-05-06 15:51:56 +02:00
Martin Sustrik
3ef7c747ac
Tore Halvorsen added to the AUTHORS file
...
Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2011-05-04 12:43:23 +02:00
Tore Halvorsen
10120214ac
Accessing an iterator after it is accessed is not valid.
...
Moving the erase after the access and check agains current_id.
2011-05-04 12:41:10 +02:00
Martin Sustrik
ceb5e1a073
Deallocation functions in zmq.h and msg_t class are consistent.
...
The two functions had different calling conventions (C vs. C++).
It is fixed now.
Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2011-05-03 23:20:43 +02:00
Martin Sustrik
5e329ba7ca
Minor patch to keep ICC compiler happy
...
ICC doesn't recognise that assert(false) terminates the program
and thus complains that certain functions have no return values.
This patch supplies dummy return values to keep the compiler happy.
Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2011-05-03 23:16:03 +02:00
Martin Sustrik
6ecec9bbf1
Current inpipe remains unchaged in XREP when other pipe terminates
...
When an inpipe terminated within XREP, it was erased from the array
and thus current_in (which is an index) pointed to a different
element in the array. This caused problems when we were in the
middle of reading a multipart message.
Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2011-05-02 19:28:51 +02:00
Martin Sustrik
e5d4cd39e1
Yet one more fix related to PUB socket and multipart messages
...
This patch fixes the activation of the pipes, when they pass
from passive state directly to active.
Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2011-05-02 19:26:30 +02:00
Pieter Hintjens
e78cc47b18
Moved tests off 5555 (conflict with Eclipse)
...
Signed-off-by: Pieter Hintjens <ph@imatix.com>
2011-05-02 18:59:55 +02:00
Martin Sustrik
eb9bc1b064
Message atomicity problem in PUB socket fixed.
...
Reaching the HWM caused breaking message atomicity when the
flow was reestablished - initial parts of multipart messages
may have been lost.
Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2011-04-30 06:48:18 +02:00
Martin Sustrik
fe2e772dd5
pgm_socket uses binary version of UUID
...
pgm_socket used textural form of UUID to generate GSIs.
The recent patch that removed support for textual UUIDs
broke the functionality. This patch fixes the problem.
Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2011-04-30 06:47:36 +02:00
Martin Sustrik
96213d5735
WSAENETUNREACH is a valid networking error
...
Till now, 0MQ asserted on Windows when connect () returned
WSAENETUNREACH.
Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2011-04-29 07:23:30 +02:00
Martin Sustrik
b2eb84f8ca
Substantial simplification of uuid_t
...
The string format of UUID is not used in 0MQ. Further on,
it turns out that UUIDs have fixed microarchitecture-agnostic
binary layout (see RFC4122). Thus, the conversion to string
and back to binary can be avoided.
Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2011-04-29 07:19:22 +02:00
Martin Sustrik
10fbc78e5c
Assert during SUB socket termination fixed.
...
Fair queueing algorithm was checking whether the current pipe
is not closed in the middle of reading a multipart message.
However, this is OK when the socket is closing down.
Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2011-04-22 07:51:24 +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
581697695a
Message validity is checked in the runtime
...
Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2011-04-19 08:08:15 +02:00
Martin Sustrik
20e0b7cdcb
zmq_socket(3) describes the EMFILE error code
...
Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2011-04-18 09:11:45 +02:00
Martin Sustrik
e3dc0b25d9
OpenPGM compilation error on OSX fixed
...
Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2011-04-18 08:55:51 +02:00
Martin Sustrik
452ea97f5b
zmq_send(3) manpage improved
...
Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2011-04-15 08:03:26 +02:00
Martin Sustrik
590ad2510b
Error handling for accept on Cygwin fixed
...
Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2011-04-15 07:59:28 +02:00
Martin Sustrik
5444064c1a
Minor cleanup of preprocessor definitions for OpenPGM
...
Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2011-04-13 10:33:54 +02:00
Martin Sustrik
933ace0919
MSVC build fixed to reflect zmq.cpp split
...
Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2011-04-13 10:06:44 +02:00
Martin Sustrik
6191213a57
Code dealing with messages moved to msg.cpp
...
Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2011-04-12 14:20:49 +02:00
Martin Sustrik
3b636d7d18
zmq_utils implementation moved to zmq_utils.cpp
...
Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2011-04-12 10:00:29 +02:00
Martin Sustrik
e6fd193760
OpenPGM now doesn't redefine bool, we can drop the workaround
...
Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2011-04-12 09:22:22 +02:00
Pieter Hintjens
a3b49ca958
Fixed example
...
Signed-off-by: Pieter Hintjens <ph@imatix.com>
2011-04-11 12:14:00 +02:00
Martin Sustrik
0839cceac9
Missing ENOTSOCK added on Win32
...
Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2011-04-09 09:46:59 +02:00
Martin Sustrik
b96fe15bb6
Run-time checking for context & socket validity added
...
Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2011-04-09 09:35:34 +02:00
Mikko Koppanen
e62686aca5
RPM packaging improvements
...
Signed-off-by: Mikko Koppanen <mkoppanen@php.net>
2011-04-09 08:45:12 +02:00
Mikko Koppanen
6fd403c4d8
Make pkg-config dependency conditional
...
Signed-off-by: Mikko Koppanen <mkoppanen@php.net>
2011-04-04 22:52:02 +02:00
Martin Sustrik
4b52cf949f
TCP and IPC connection initiation allow for multiple properties
...
So far the only property passed on connection initiation was
identity. The mechanism was now made extensible. Additional
properties are needed to introduce functionality such as
checking the peer's socket type, "subports" etc.
Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2011-04-04 17:53:49 +02:00
Martin Sustrik
8203c4dbb2
Another error handling issue on Win32 solved
...
Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2011-04-04 13:12:46 +02:00
Martin Sustrik
475ba3849d
Issue with error checking on Win32 platform fixed
...
Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2011-04-04 12:49:39 +02:00
Martin Sustrik
1842628b90
Unreferenced variable removed
...
Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2011-04-04 12:12:06 +02:00
Robert G. Jakabosky
2c7af35827
Add note about thread-safety to zmq_msg_init_data() manpage.
...
Signed-off-by: Robert G. Jakabosky <bobby@sharedrealm.com>
2011-04-03 20:44:02 +02:00
Martin Sustrik
54ea458f62
Git ignores .gcno files
...
Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2011-04-03 07:36:02 +02:00
Mikko Koppanen
a48b6cfc00
Additional gcov changes
...
Signed-off-by: Mikko Koppanen <mkoppanen@php.net>
2011-04-03 07:34:14 +02:00
Mikko Koppanen
656b646bc6
Large rename: AC_ZMQ_ to LIBZMQ_ and ac_zmq_ to libzmq_. Fixes "warning suspicious cache-id"
...
Signed-off-by: Mikko Koppanen <mkoppanen@php.net>
2011-04-02 22:50:46 +02:00
Mikko Koppanen
bdeddb89f7
Added code coverage checking
...
Signed-off-by: Mikko Koppanen <mkoppanen@php.net>
2011-04-02 22:49:41 +02:00
Mikko Koppanen
7af18468f8
Add option to build with system opepgm
...
Signed-off-by: Mikko Koppanen <mkoppanen@php.net>
2011-04-02 22:48:52 +02:00
Martin Sustrik
0e0e4559a0
Project location on github changed in README file
...
Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2011-04-02 19:32:44 +02:00
Pieter Hintjens
3e655227bd
Fixed memory leak with threads on win32
...
Signed-off-by: Pieter Hintjens <ph@imatix.com>
2011-04-02 09:22:41 +02:00
Martin Sustrik
85c2a84036
inproc perf tests now work on Windows
...
Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2011-04-02 09:50:35 +02:00
Martin Sustrik
54830ac0f6
MSVC build system updated to match 3.0 changes
...
Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2011-04-02 09:03:57 +02:00
Martin Sustrik
ae90d3bdbe
inproc_lat and inproc_thr added to .gitignore
...
Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2011-04-01 11:55:10 +02:00
Martin Sustrik
599df5203c
PGM wire format specification improved in zmq_pgm(7)
...
Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2011-04-01 11:53:51 +02:00
Martin Sustrik
cce57617c7
Ian Barber and Zed Shaw added to credits section
...
talks on conferences, videos
Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2011-03-31 23:49:28 +02:00
Martin Sustrik
5142a1624b
Robert G. Jakabosky added to the AUTHORS file
...
Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2011-03-31 23:16:14 +02:00
Robert G. Jakabosky
d84558e172
Adding thread latency/throughput perf. examples.
...
Signed-off-by: Robert G. Jakabosky <bobby@sharedrealm.com>
2011-03-31 23:14:38 +02:00
Mikko Koppanen
fbf1f51468
Upstream the openpgm build fixes. Add DSO symbol visibility to OpenPGM builds
...
Signed-off-by: Mikko Koppanen <mkoppanen@php.net>
2011-03-31 18:42:09 +02:00
Martin Sustrik
d36d9a378a
Comments improvement
...
related to fairness while reading/writing large messages
Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2011-03-27 19:41:32 +02:00
Martin Sustrik
17fdb5e3a8
zmq_recv() returns size of the message even if it's truncated
...
Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2011-03-27 09:50:25 +02:00
Martin Sustrik
82dbef360c
Memory leak in zmq_recv fixed
...
Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2011-03-26 11:05:55 +01:00