Commit Graph

62 Commits

Author SHA1 Message Date
Doron Somech
3da84c6d06 problem: no thread-safe alternative for ZMQ_PAIR
Solution: create ZMQ_CHANNEL, the thread safe alternative
2020-05-09 08:49:01 +03:00
Luca Boccassi
ada6f0c058
Merge pull request #3871 from somdoron/DISCONNECT_MSG
problem: router doesn't know when peer disconnected
2020-04-18 10:49:50 +01:00
Gudmundur Adalsteinsson
9c6738bb45 Problem: No support to query poller size
Solution: Add zmq_poller_size that queries the number
of objects registered, allowing safer usages of poller
to avoid livelock situations.
2020-04-17 18:37:01 +00:00
Doron Somech
81444136d5 problem: router doesn't know when peer disconnected
ZMQ_ROUTER_NOTIFY doesn't have a context and doesn't play nice with protocols. with ZMQ_DISCONNECT_MSG we can set it to a protocol message, like DISCONNECT in majordomo. Router will send it when a peer is disconnected. Another advantage of ZMQ_DISCONNECT_MSG is that it also works on inproc.

Together with ZMQ_HEARTBEAT it allows to build very reliable protocols, and much simpler as well.
2020-04-17 18:04:28 +03:00
Doron Somech
93da6763b0 problem: ZMQ_HEARTBEAT is not useful without sending an hello message
When using ZMQ_HEARTBEAT one still needs to implement application-level heartbeat in order to know when to send a hello message.
For example, with the majordomo protocol, the worker needs to send a READY message when connecting to a broker. If the connection to the broker drops, and the heartbeat recognizes it the worker won't know about it and won't send the READY msg.
To solve that, the majordomo worker still has to implement heartbeat. With this new option, whenever the connection drops and reconnects the hello message will be sent, greatly simplify the majordomo protocol, as now READY and HEARTBEAT can be handled by zeromq.
2020-04-17 14:54:58 +03:00
Gudmundur Adalsteinsson
7b1fef28f9
Problem: boilerplate when init msg from data copy (#3860)
* Problem: boilerplate when init msg from data copy

Solution: Add zmq_msg_init_buffer to construct
a message by copying memory from buffer.
2020-04-09 23:59:43 +01:00
Bill Torpey
debbe08fb8
add option to stop trying to reconnect on ECONNREFUSED (#3831)
* add option to stop trying to reconnect on ECONNREFUSED
2020-02-23 17:17:22 +00:00
Doron Somech
70bc7dd925 problem: zeromq doesn't has a thread-safe peer to peer socket
Solution: a new socket type, called PEER. Very similar to SERVER, but can only connect to other PEERs. Also a new zmq_connect_peer method, that connect and return a routing-id in thread-safe and atomic operation
2020-02-09 23:20:14 +02:00
Luca Boccassi
ddae567f16 Problem: ZMQ_WSS socket options not defined in src/zmq_draft.h
Solution: add them
2020-01-19 14:39:29 +00:00
Andrij Abyzov
5a854780f2 Problem: cannot send arbitrary data from XSUB to XPUB.
Solution: now if the first frame in a multipart message is not subscribe/unsubscribe,
the rest of the parts are also considered to be not subscribe/unsubscribe.
2019-12-04 16:25:08 +01:00
Francesco Montorsi
b3582da8fb Introduce extended set/get methods for ZMQ contexts (#3642)
* Introduce DRAFT zmq_ctx_set_ext() and zmq_ctx_get_ext() methods. Change
ZMQ_THREAD_NAME_PREFIX to allow for non-numeric thread name prefixes.
2019-08-27 23:41:23 +01:00
jean-airoldie
cfcab66c71 Problem: {in,out}_batch_size must be configured at compiled time
Solution: Added a socket option to configure them at runtime.
2019-06-27 02:31:11 -04:00
Christophe Guillon
58c30dc7d1 Add support for SOCKS5 basic authentication 2019-06-10 16:40:06 +02:00
Luca Boccassi
19ff4d0b6a Problem: zmq_socket_monitor_versioned_typed duplicates zmq_socket_monitor_versioned
Solution: unify the two APIs, as they are both still in DRAFT state and
thus can be changed.
2019-05-18 16:44:07 +01:00
imkcy9
2f98f7034b Support XPub socket send last value caching to last subscription pipe with ZMQ_XPUB_MANUAL_LAST_VALUE. (#3511)
* Add ZMQ_XPUB_MANUAL_LAST_VALUE

* Surpport xpub send last value caching to one pipe with ZMQ_XPUB_MANUAL_LAST_VALUE

* Add test_xpubub_manual_last_value

* Add relicense and doc
2019-05-17 22:12:32 +01:00
jean-airoldie
606a8f7967 Problem: Socket monitoring only allows ZMQ_PAIR
Solution: Allow ZMQ_PUB and ZMQ_PUSH sockets types for the monitoring.
This way someone could create a ZMQ_PULL socket connected to multiple
monitoring sockets at the same time.
2019-05-15 01:48:46 -04:00
Simon Giesecke
63c4d8be78 Problem: syntax error on Windows related to socket descriptor type
Solution: use proper fd_t type, and also define and use a zmq_fd_t in the API
2019-05-09 07:21:08 -04:00
jean-airoldie
046534480b Problem: Cannot get thread safe socket fd
Solution: Add a method to get the zmq_poller's signaler fd. Then we can
associate a poller instance with every thread safe socket and use its
fd.
2019-04-27 22:58:42 -04:00
Luca Boccassi
feadf6d40f Problem: cannot monitor state of queues at runtime
Solution: add API and ZMQ_EVENT_PIPES_STATS event which generates 2
values, one for the egress and one for the ingress pipes respectively.
Refactor the events code to be able to send multiple values.
2019-02-10 16:33:26 +00:00
Simon Giesecke
01371398e9 Problem: monitor events are unversioned
Solution: add monitor event socket option
2019-02-02 15:33:27 +01:00
Luca Boccassi
35c6985e68 Problem: zmq_stopwatch_intermediate is eligible for STABLE
Solution: do it
2018-11-18 13:23:38 +00:00
Luca Boccassi
92cf6c6451 Problem: new ctx THREAD options are eligible for STABLE
Solution: do it
2018-11-18 13:23:38 +00:00
Luca Boccassi
c347aef794 Problem: new DRAFT monitoring events are eligible for STABLE
Solution: do it
2018-11-18 13:23:38 +00:00
Szekely Gyorgy
2cdad3d0ce Add ZMQ_ROUTER_NOTIFY draft socket option (#3213)
* Add ZMQ_ROUTER_NOTIFY draft socket option
2018-08-15 08:54:08 +01:00
Luca Boccassi
3159161cef Problem: zmq_timers_* are ready for STABLE
Solution: move them from DRAFT state to STABLE
2018-07-27 23:07:56 +01:00
Simon Giesecke
c581f43c97 Problem: parameter naming style inconsistent
Solution: define and apply parameter naming style: lower_case_
2018-05-26 09:34:44 +02:00
Lionel Flandrin
99412c810d Problem: ZMQ doesn't expose the MULTICAST_LOOP socket option
Solution: add a new ZMQ_MULTICAST_LOOP option for UDP sockets.
2018-05-10 19:24:46 +02:00
Luca Boccassi
6f26a33359 Problem: 4.2.5 is out, we need to restore API changes and 4.3.x
Solution: revert the revert!

Revert "Problem: regression in 4.2.3 went unnoticed, want to release 4.2.5"

This reverts commit 5f17e26fa4.
2018-03-23 19:31:42 +00:00
Luca Boccassi
5f17e26fa4 Problem: regression in 4.2.3 went unnoticed, want to release 4.2.5
Solution: revert DRAFT -> STABLE API transition so that we can do a
bugfix-only 4.2.5 release.
Will be re-reverted once tagged.

Revert "Problem: ZMQ_BINDTODEVICE has met STABLE conditions"

This reverts commit 3cb79f5042.

Revert "Problem: ZMQ_MSG_GSSAPI_* have met STABLE conditions"

This reverts commit 374da4207b.

Revert "Problem: ZMQ_MSG_T_SIZE has met STABLE conditions"

This reverts commit 6411c4a247.

Revert "Problem: docs say STABLE API still in DRAFT"

This reverts commit 9f2f30b7ff.
2018-03-23 11:22:10 +00:00
Luca Boccassi
3cb79f5042 Problem: ZMQ_BINDTODEVICE has met STABLE conditions
Solution: move them from DRAFT to STABLE since it's been in a public
release, committed for 6+ months and has not changed.
2018-03-21 16:45:41 +00:00
Luca Boccassi
374da4207b Problem: ZMQ_MSG_GSSAPI_* have met STABLE conditions
Solution: move them from DRAFT to STABLE since it's been in a public
release, committed for 6+ months and has not changed.
2018-03-21 16:45:41 +00:00
Luca Boccassi
6411c4a247 Problem: ZMQ_MSG_T_SIZE has met STABLE conditions
Solution: move it from DRAFT to STABLE since it's been in a public
release, committed for 6+ months and has not changed.
Given a new STABLE symbol has been added, bump minor version number.
2018-03-21 16:45:41 +00:00
Pontus Sköldström
dd5eec35be Support application metadata through ZMQ_METADATA
Lets the application set per-connection metadata.
Metadata is specified as "X-key:value" and set using zmq_setsockopt, eg:
zmq_setsockopt (s, ZMQ_METADATA, "X-key:value", 11);

The peer can then obtain the metadata from a received message:
char *data = zmq_msg_gets(msg, "X-key");
2018-03-14 12:56:15 +01:00
Stefan Kaes
fcbd2a5710 Problem: enormous memory increase due to zero copy decoding
The zero copy decoding strategy implemented for 4.2.0 can lead to a large
increase of main memory usage in some cases (I have seen one program go up to
40G from 10G after upgrading from 4.1.4). This commit adds a new option to
contexts, called ZMQ_ZERO_COPY_RECV, which allows one to switch to the old
decoding strategy.
2018-03-05 18:13:28 +01:00
Simon Giesecke
a5e763039d Problem: use of TCP loopback fastpath not available for user sockets
Solution: add socket option
2018-02-09 14:22:42 +01:00
sigiesec
88d8c768d1 Problem: test_timers frequently fails on travis-ci
Solution: relaxed test assertions, based on the actual time passed,
instead of assuming that this equals to the time slept
2018-02-09 09:55:40 +01:00
sigiesec
41f459e1dc Problem: formatting inconsistent
Solution: applied clang-format
2018-02-02 15:47:43 +01:00
f18m
2aa0e6fd4d Change ZMQ_THREAD_AFFINITY to ZMQ_THREAD_AFFINITY_CPU_ADD/ZMQ_THREAD_AFFINITY_CPU_REMOVE. Avoid prefix thread names when no prefix was set. 2017-10-25 09:55:47 +02:00
f18m
f25cd6e7be Background thread names (#2784)
* Add ZMQ_THREAD_NAME_PREFIX ctx option
2017-10-17 12:06:50 +01:00
f18m
bfbb4ff2e9 Background threads enhancements (#2778)
* Background thread scheduling 

- add ZMQ_THREAD_AFFINITY ctx option; set all thread scheduling options
from the context of the secondary thread instead of using the main
process thread context!
- change ZMQ_THREAD_PRIORITY to support setting NICE of the background
thread when using SCHED_OTHER
2017-10-16 12:29:03 +01:00
Luca Boccassi
b6aee51691 Problem: strict ZAP protocol adherence is backward incompatible
Solution: add ZMQ_ZAP_ENFORCE_DOMAIN to hide backward incompatible
change and make it disabled by default.
In a future release that breaks API compatibility we can then switch
the default to enabled in order to achieve full RFC compatibility.

Fixes #2762
2017-10-09 17:48:33 +01:00
sigiesec
a5e3a65ae2 Problem: inconsistency between zmq.h and zmq_draft.h
Solution: fix zmq_draft.h
2017-09-19 17:55:00 +02:00
sigiesec
9e7507b38b Problem: term "identity" is confusing
Solution: replace by "routing id"
2017-09-19 17:53:44 +02:00
Doron Somech
af03241dcb Revert "Problem: term "identity" is confusing" 2017-09-07 15:47:43 +03:00
sigiesec
1daf83079a Problem: term "identity" is confusing
Solution: replace by "routing id"
2017-09-06 17:45:56 +02:00
sigiesec
79e28af4ce Problem: new function zmq_socket_get_peer_state not in zmq_draft.h
Solution: added function to zmq_draft.h
2017-09-01 17:15:23 +02:00
Luca Boccassi
c8097af884 Problem: DRAFT GSSAPI socket options in wrong section cause duplication
Solution: move them together with the other DRAFT socket options, and
change value of DRAFT ZMQ_BINDTODEVICE from 90 to 92 to avoid clash
2017-08-19 17:40:15 +01:00
sigiesec
e22ca065d6 Problem: curve_client_t does not emit handshake failure events
Solution: add handshake failure events to curve_client_t
2017-08-18 09:18:06 +02:00
sigiesec
9bec68354c Problem: console output for NULL protocol errors
Solution: emit socket monitor events for NULL protocol errors (like CURVE)
2017-08-18 09:18:06 +02:00
sigiesec
e2d3ba9c62 Problem: classification ZMQ_HANDSHAKE_FAILED_* events is coarse-grained and partially misleading
Solution: redesign ZMQ_HANDSHAKE_FAILED_* events, introduce new class of ZMQ_HANDSHAKE_FAILED_AUTH events
2017-08-18 09:17:59 +02:00