Commit Graph

478 Commits

Author SHA1 Message Date
Luca Boccassi
ac5c75cea1 Problem: 4.2.2 is out, version(s) are out of date
Solution: bump changelog, ABI revision, library and packaging version
2017-02-18 17:56:55 +00:00
Luca Boccassi
7c0ded93af Problem: 4.2.1 is out, time to bump versions
Solution: add new changelog entry, bump library version in zmq.h and
bump ABI version in configure.ac and CMakeLists.txt
2016-12-31 16:26:41 +01:00
Vincent Tellier
48bc75e8a1 Code formatting + reverted hard error handshake fail
- Moved new events in draft section + added to zmq_draft.h
 - Removed the remainning tabs
 - Reverted the hard error (back to soft error) in curve_server.cpp

=> The feature doesn't works anymore
2016-12-30 18:34:33 +01:00
Vincent Tellier
b6e9e0c2d3 Fixed issue #2227
Added two new monitoring events:
 - ZMQ_EVENT_HANDSHAKE_SUCCEED is raised once the encryption handshake succeed
 - ZMQ_EVENT_HANDSHAKE_FAILED is raised when it failed
Both events are raised on server and client side.
2016-12-30 16:26:42 +01:00
Luca Boccassi
113feb60a2 Problem: ZMQ_MSG_T_SIZE draft but not in DRAFT section
Solution: move it there, add it to src/zmq_draft.h and clarify in the
documentation and in the NEWS file that this option is not yet stable
2016-12-29 21:07:39 +01:00
Luca Boccassi
57db5f2a5c Problem: 4.2.0 won't compile on AIX 7.1
Solution: restore inclusion of poll.h if using poll before zmq.h as
it was originally, as AIX redefines the POSIX structures and provides
compatibility macros.
Also add alternative aliases for 32 bit AIX's pollitem struct:
  events -> reqevents
  revents -> rtnevents
2016-12-05 22:50:10 +00:00
Luca Boccassi
670bec56d8 Problem: size of zmq_msg_t is not known to FFI wrappers
Solution: add a ZMQ_MSG_T_SIZE context read-only option so that
wrappers can call zmq_ctx_get (ctx, ZMQ_MSG_T_SIZE) to get the
size at runtime.
2016-11-20 12:24:03 +00:00
Luca Boccassi
8015794b81 Problem: 4.2.0 is out, time to bump version for development
Solution: update NEWS, include/zmq.h and packaging
2016-11-08 12:54:53 +00:00
Luca Boccassi
b5b5f75242 Problem: socket option marked as draft for 4.2
Solution: move comment further below to declare new socket
options as stable for the 4.2.0 release.
2016-11-01 18:49:42 +00:00
Luca Boccassi
2484d1c859 Problem: MS VC++ build broken
Solution: try to detect architecture if building with VC++ and
hardcode pointer size accordingly.
Expressions are not allowed inside declspec intrinsics, which
includes other intrinsics.
2016-10-28 17:14:00 +01:00
Luca Boccassi
df367a6682 Problem: pointer union for zmq_msg_t is a hack
Solution: use compiler's alignment attributes instead which is
clearer and less of a hack.
Pointer alignment violations causing crashes on architectures
such as sparc64 and aarch64.
This also avoid triggering ABI checkers as the change is compatible
even though applications that suffer from the bug should rebuild to
take advantage of the fix.
2016-10-28 15:18:48 +01:00
Min RK
de7fc1fcf8 add n_events argument to zmq_poller_wait_all
avoids unnecessary heap allocations, races on the number of items
2016-09-27 14:37:52 +02:00
Min RK
2bc9796651 Problem: zmq_poller only signals one event
Solution: zmq_poller_wait_all signals all events

allows signaling multiple events with one call to zmq_poller_wait_all
rather than emitting only one event.

this prepares for zmq_poll being based on zmq_poller,
which requires events for all sockets rather than just one.
2016-09-27 13:39:16 +02:00
Yann Diorcet
9835e18f64 Fix compilation with mingw64 using autotools 2016-06-01 15:07:16 +02:00
evoskuil
460bc7525b Problem: no function to derive curve public key from secret key. 2016-05-18 23:51:18 -07:00
Bitiquinho
365c8eda72 Add dgram_t class (based on stream socket and udp engine) 2016-05-15 15:35:35 -03:00
hitstergtd
b3bb0b7f1c Problem: zmq_sendiov/zmq_recviov not Deprecated
Solution:
As preparation for 4.2 release, move the zmq_sendiov and zmq_recviov API
methods under the Deprecated Methods section.

Note: the actual methods have NOT been deprecated yet, functionally speaking
however it is good to let API users know early. Moreover, these methods were
not ever considered stable, at least according to src/zmq.h, and have no
associated man pages.
2016-05-04 16:48:10 +01:00
Doron Somech
ba20f665ae problem: SRCFD is redundant as we have metadata 2016-05-04 15:33:20 +03:00
Doron Somech
a192663ece Merge pull request #1951 from hitstergtd/x-monitorcomment-fix
Problem: supported protocols comment is stale
2016-05-04 09:56:46 +03:00
Doron Somech
b3667cccf9 mark zmq_msg new methods as draft 2016-05-03 10:44:00 +03:00
Luca Boccassi
6de24c190a Problem: scatter/gather are not yet stable APIs
Solution: mark them as DRAFT APIs
2016-05-02 21:47:05 +01:00
Luca Boccassi
caaf66c32c Problem: radio/dish are not yet stable APIs
Solution: mark them as DRAFT APIs
2016-05-02 21:47:05 +01:00
Luca Boccassi
32a1ef85a8 Problem: zmq_timers* are not yet stable APIs
Solution: mark them as DRAFT APIs
2016-05-02 21:47:05 +01:00
Luca Boccassi
738968082b Problem: zmq_poller* are not yet stable APIs
Solution: mark them as DRAFT APIs
2016-05-02 21:47:05 +01:00
Luca Boccassi
7e700f1e73 Problem: client/server are not yet stable APIs
Solution: mark them as DRAFT APIs
2016-05-02 21:47:05 +01:00
Luca Boccassi
064cd1fbfb Problem: no support for DRAFT API in build systems
Solution: add support for --enable-drafts/ENABLE_DRAFTS=ON in
Autools and CMake.
2016-05-02 21:47:05 +01:00
hitstergtd
1ab7dd0122 Problem: supported protocols comment is stale
Solution:
Fix it and align with the documentation; zmq_socket_monitor(3) outlines
that ZMQ socket monitoring is supported for TCP, IPC and TIPC.
2016-05-01 22:00:20 +01:00
hitstergtd
a4b426b18e Problem: typos/trailing spaces in code comments
Solution: fix them
2016-04-25 11:16:26 +01:00
somdoron
9798f74d17 add have timers define to detect if timers class available 2016-04-24 12:30:35 +03:00
somdoron
e6dae56c6e Scatter-Gather socket types 2016-04-21 14:50:58 +03:00
Jim Klimov
d7d917139b Problem: including recent "zmq_utils.h" crashes gcc -pedantic jobs
Problem: Recent deprecation of the "zmq_utils.h" header file caused pedantic compilations (including czmq) to fail because non-portable #warning is used.
Solution: Limit the deprecation warnings to compilers known or assumed to support the "#pragma message" (GCC, MSVC, CLANG) and wrap with GCC directives to not treat these warnings as errors on paranoid builds.
2016-04-05 17:03:17 +02:00
Geof Nieboer
8c7b19b1b7 Update zmq_utils.h
Previous change broke MSVC b/c MSVC doesn't support #warning
2016-03-30 00:00:49 +03:00
Ben Gray
7cc50d0005 parameter naming consistency [aesthetic] 2016-03-11 09:15:58 +00:00
Min RK
d5b66295d4 Deprecate zmq_utils.h
instead of removing it, which breaks downstream builds.
2016-02-18 10:28:07 +01:00
Pieter Hintjens
62c66ae7f7 Problem: test_large_msg kills my system temporarily
And I'm on a reasonably sized laptop. I think allocating INT_MAX
memory is dangerous in a test case.

Solution: expose this as a context option. I've used ZMQ_MAX_MSGSZ
and documented it and implemented the API. However I don't know how
to get the parent context for a socket, so the code in zmq.cpp is
still unfinished.
2016-02-09 10:55:09 +01:00
Pieter Hintjens
7470c00d4d Problem: ZMQ_TCP_RECV_BUFFER/SEND_BUFFER are redundant
These options are confusing and redundant. Their names suggest
they apply to the tcp:// transport, yet they are used for all
stream protocols. The methods zmq::set_tcp_receive_buffer and
zmq::set_tcp_send_buffer don't use these values at all, they use
ZMQ_SNDBUF and ZMQ_RCVBUF.

Solution: merge these new options into ZMQ_SNDBUF and ZMQ_RCVBUF.

This means defaulting these two options to 8192, and removing the
new options. We now have ZMQ_SNDBUF and ZMQ_RCVBUF being used both
for TCP socket control, and for input/output buffering.

Note: the default for SNDBUF and RCVBUF are otherwise 4096.
2016-02-09 10:53:52 +01:00
Pieter Hintjens
7f6ed167fc Problem: ZMQ_XPUB_VERBOSE_UNSUBSCRIBE is clumsy
This option has a few issues. The name is long and clumsy. The
functonality is not smooth: one must set both this and
ZMQ_XPUB_VERBOSE at the same time, or things will break mysteriously.

Solution: rename to ZMQ_XPUB_VERBOSER and make an atomic option.

That is, implicitly does ZMQ_XPUB_VERBOSE.
2016-02-09 10:53:52 +01:00
Pieter Hintjens
da8ce55a14 Problem: ZMQ_TCP_RETRANSMIT_TIMEOUT is a clumsy name
Solution: rename to ZMQ_MAXRT

This is the option name used on Windows, so easier to use and
remember.
2016-02-09 10:53:52 +01:00
Luca Boccassi
edc4ee03e8 Problem: ZMQ_USEFD does not follow conventions
Solution: rename socket option (and variables and files) from usefd
to use_fd.
2016-02-09 09:36:14 +00:00
Luca Boccassi
c158178798 Problem: ZMQ_PRE_ALLOCATED_FD is too long
Solution: rename socket option (and variables and files) from
pre_allocated_fd to usefd.
2016-02-08 22:46:34 +00:00
Luca Boccassi
4bcbb3055e Problem: cannot use pre-allocated FDs. Fixes #777
Solution: add new [set|get]sockopt ZMQ_PRE_ALLOCATED_FD to allow
users to let ZMQ use a pre-allocated file descriptor instead of
allocating a new one. Update [set|get]sockopt documentation and
test accordingly.

The main use case for this feature is a socket-activated systemd
service. For more information about this feature see:
http://0pointer.de/blog/projects/socket-activation.html
2016-02-04 16:57:26 +00:00
Constantin Rack
7da3ee138e Problem: deprecated zmq_utils.h is still included
Solution: remove all remaining references to `zmq_utils.h`
2016-02-01 11:34:36 +01:00
sunkin351
9b01ae826e Restoring zmq_utils.h from previous version
I hope restoring this from a previous version doesn't do any damage, it
is missing in the current version of this repository and is vital for
the lib to compile anywhere.
2016-01-31 20:19:04 -08:00
Constantin Rack
af775c0c8b Problem: zmq_utils.h is deprecated since 2014-07-09
Solution: remove this file
2016-02-01 00:54:53 +01:00
somdoron
68675e23d9 adds group to zmq_msg 2016-01-29 10:53:42 +02:00
Constantin Rack
a539b0c6e8 Problem: copyright year is still 2015
Solution: update to 2016
2016-01-28 15:07:31 +01:00
somdoron
b8425a25cf radio-dish pattern 2016-01-27 18:22:48 +02:00
Min RK
6ee78707c6 restore check for MSC 1600 before including stdint.h 2016-01-18 12:33:51 +01:00
Pieter Hintjens
7893a6ac26 Problem: zmq poller API is not CLASS conformant
Solution: change zmq_poller_close(p) to zmq_poller_destroy(&p)
2015-12-21 11:01:16 +01:00
Pieter Hintjens
f8b9ca5f42 Problem: zmq timers API is not CLASS conformant
If we're going to add CLASS-like APIs we should use the proper
syntax; specifically 'destroy' instead of 'close', which is a
hangover from the 'ZeroMQ is like sockets' model we're slowly
moving away from.

Solution: change zmq_timers_close(p) to zmq_timers_destroy(&p)
2015-12-21 10:56:37 +01:00
somdoron
aadaf99011 add timers API to libzmq 2015-12-18 12:23:22 +02:00
Ilya Kulakov
68b13fbddb Add the VMCI transport.
VMCI transport allows fast communication between the Host
and a virtual machine, between virtual machines on the same host,
and within a virtual machine (like IPC).

It requires VMware to be installed on the host and Guest Additions
to be installed on a guest.
2015-12-08 13:16:09 +06:00
Jim Hague
e71471b2e8 Add new option ZMQ_MULTICAST_MAXTPDU to set PGM_MTU.
Fixes #1646
2015-11-23 19:35:02 +00:00
Jens Auer
cdeec4c115 New options to set send/recv buffer size for TCP sockets. 2015-11-08 19:00:29 +01:00
somdoron
da2bc60abe Removing zmq_pollfd as it is replaced by zmq_poller 2015-10-22 11:52:24 +03:00
somdoron
24fc0d4e89 drop the socket postfix from poller methods 2015-10-21 14:04:33 +03:00
somdoron
024819b491 add ZMQ_HAVE_POLLER define to check if ZMQ_POLLER exist 2015-10-21 10:17:33 +03:00
somdoron
476ba22e0a ZMQ_Poller support more event types 2015-10-21 10:14:36 +03:00
somdoron
6501b8089f port zpoller to libzmq as zmq_poller 2015-10-18 21:07:23 +03:00
Pieter Hintjens
87f2dff38c Problem: zmq_msg_get_routing_id () is not consistent with API
We do not use 'get' for getters.

Solution: rename to zmq_msg_routing_id () for public API.
2015-09-11 13:15:00 -04:00
Joe Eli McIlvain
33419425eb Problem: Private/internal macros defined in public header.
Solution: Move the macros to a private header.
2015-08-21 16:12:22 -07:00
reza.ebrahimi
63260d8701 rename ZMQ_UNUSED macro to LIBZMQ_UNUSED 2015-08-22 00:31:25 +04:30
Joe Eli McIlvain
61217a2686 Problem: Source files contain mixed tabs and spaces.
Solution: Convert to spaces and remove trailing whitespace in these files.
2015-08-20 07:46:34 -07:00
somdoron
4da5ff6a7d revert to original zmq_polland creating zmq_pollfd_poll for polling on pollfd 2015-08-17 18:57:47 +03:00
Constantin Rack
a96f16e3fa Merge pull request #1534 from somdoron/master
problem: new poller field in zmq_pollitem_t is changing the api
2015-08-17 13:40:26 +02:00
somdoron
d83b045347 rename poller to pollfd 2015-08-17 14:20:49 +03:00
somdoron
5bae6911af remove poller field, using fd instead 2015-08-17 11:56:23 +03:00
reza.ebrahimi
7058c54672 apply a change to LIBZMQ_DELETE macro (related to issue #1524) 2015-08-17 01:00:55 +04:30
reza.ebrahimi
1621c25ef0 define a macro for heap object deletion in a unified manner (related to issue #1524) 2015-08-17 00:35:11 +04:30
somdoron
9d829f72f4 moving new poller field to the end of the struct 2015-08-16 18:00:32 +03:00
somdoron
a63818904d add methods to handle poller 2015-08-16 13:57:28 +03:00
somdoron
34968771ca add an option to check if the socket is thread safe 2015-08-16 11:50:50 +03:00
reza.ebrahimi
bff2284a50 place a ZMQ_UNUSED macro and replace all unused variables with ZMQ_UNUSED macro 2015-08-14 15:40:39 +04:30
KIU Shueng Chuan
ca9215de1e add ZMQ_TCP_RETRANSMIT_TIMEOUT socket option 2015-08-06 23:36:27 +08:00
KIU Shueng Chuan
c0ca2be642 add ZMQ_CONNECT_TIMEOUT socket option 2015-08-04 22:17:02 +08:00
Ricardo Catalinas Jiménez
ec5592db1f Fix 1478: receive unsubscriptions in XPUB when verbose
Fixes not receiving unsubscription messages in XPUB socket with
ZMQ_XPUB_VERBOSE and using a XSUB-XPUB proxy in front.

This adds two modifications:

- It adds a new flag, ZMQ_XPUB_VERBOSE_UNSUBSCRIBE, to enable verbose
  unsubscription messages, necessary when using a XSUB/XPUB proxy.

- It adds a boolean switch to zmq::mtrie_t::rm () to control if the
  callback is invoked every time or only in the last removal. Necessary
  when a pipe is terminated and the verbose mode for unsubscriptions is
  enabled.
2015-07-23 12:02:34 +01:00
Jonathan Reams
cbb3b176a6 Add ZMTP heartbeats
This commit adds ZMTP connection heartbeats described in
http://rfc.zeromq.org/spec:37/ZMTP.
2015-06-24 13:24:53 -04:00
Pieter Hintjens
8620c3e032 Problem: source file headers are somewhat confusing about LGPLv3
Of course people still "can" distributed the sources under the
LGPLv3. However we provide COPYING.LESSER with additional grants.

Solution: specify these grants in the header of each source file.
2015-06-02 22:33:55 +02:00
somdoron
862cd41c65 implement client socket type and drop messages when more flag is set on client and server 2015-02-02 11:59:13 +02:00
somdoron
5632b57b4a adds server socket type and routing id to msg 2015-02-02 01:17:37 +02:00
Thomas Rodgers
d9fb1d36ff resolve #1325 Alignment issue with zmq_msg_t on SPARC CPU
should be backported probably
2015-01-27 09:20:39 -06:00
Julien Ruffin
cf2238f80e Added socket option ZMQ_INVERT_MATCHING.
ZMQ_INVERT_MATCHING reverses the PUB/SUB prefix matching. The subscription
list becomes a rejection list. The PUB socket sends messages to all
connected (X)SUB sockets that do not have any matching subscription.

Whenever the option is used on a PUB/XPUB socket, any connecting SUB
sockets must also set it or they will reject everything the publisher
sends them. XSUB sockets are unaffected because they do not filter out
incoming messages.
2015-01-26 17:59:43 +01:00
Pieter Hintjens
6ced7027a0 Problem: commit afb24b53 broke ZMQ_STREAM contract
Symptom is that ZMQ_STREAM sockets in 4.1.0 and 4.1.1 generate zero
sized messages on each new connection, unlike 4.0.x which did not do
this.

Person who made this commit also changed test cases so that contract
breakage did not show. Same person was later banned for persistently
poor form in CZMQ contributions.

Solution: enable connect notifications on ZMQ_STREAM sockets using a
new ZMQ_STREAM_NOTIFY setting. By default, socket does not deliver
notifications, and behaves as in 4.0.x.

Fixes #1316
2015-01-23 15:25:40 +01:00
Pieter Hintjens
94d9a4ffdf Problem: copyright statements are out of date
Solution: update for 2015

Fixes #1320
2015-01-22 10:32:37 +01:00
Thomas Rodgers
90194036bf Increase size of zmq_msg_t to 64 bytes
Increasing it would have at least two benefits -

* More messages would be 'VSM' messages, so it would reduce allocation
overhead a bit.
* Remove any chance of false sharing of things that are, by design,
pushed by value onto a ypipe_t<msg_t> which is shared between two threads.

The only downside I see is slightly increased memory consumption on memory
constrained applications.

- Full discussion of this rationale is part of issue #1295
2015-01-10 16:44:55 -06:00
Thomas Rodgers
7c0a644625 Remove of ZMQ_IDENTITY_FD socket option
Revert "linking fd to pipe identity via socket option"

This reverts commit fe3e8c5c70.

Conflicts:
	include/zmq.h
	src/pipe.hpp
	src/session_base.cpp
2015-01-09 17:28:50 -06:00
Richard Newton
b1305bbec3 Remove int typedefs and use stdint.h for windows. 2015-01-05 13:45:39 +00:00
Pieter Hintjens
89a2041755 Problem: incomplete definition of integer types
Firstly, only a few types are defined, leaving it hard for higher layers
to complete the set. Secondly, the code incorrectly tries to use ifndef
to avoid re-defining typedefs, which does not work in C.

Solution: define all types, unconditionally for all MSVC compilers.
Additionally, define ZMQ_DEFINED_STDINT that tells higher layers that we
already defined these integer types.
2014-12-31 13:26:48 +01:00
Pieter Hintjens
04664f0ef7 Problem: 'bool' is not defined by default
zmq_atomic_counter_dec returned a 'bool' value, yet this isn't
defined by standard, so causes compile errors in upstream code.

Solution: return an int that can be safely converted to bool if
needed by bindings.
2014-12-23 15:20:10 +01:00
Pieter Hintjens
2de940b422 Problem: need atomic reference counting in several projects
Solution: as libzmq already provides this across all platforms,
expose an atomic counter API. I've not wrapped atomic pointers,
though someone who needs this may want to do so.
2014-12-23 01:14:38 +01:00
somdoron
768b62eb9d xpub welcome msg 2014-11-26 14:20:55 +02:00
somdoron
96e29f1455 Add manual control over subscriptions to Pub 2014-11-26 13:08:39 +02:00
Pieter Hintjens
b6e61d72b2 Problem: linger values other than -1 or 0 are unsafe
Solution: set defaults back to infinity, and add new context
option, ZMQ_BLOCKY that the user can set to false to get a
less surprising behavior on context termination. Eg.

    zmq_ctx_set (ctx, ZMQ_BLOCKY, false);
2014-11-17 11:56:59 +01:00
Pieter Hintjens
0d459318e3 Revert "ZMQ API diverges from POSIX" 2014-10-20 23:18:18 +02:00
Pieter Hintjens
527eddc90d Merge pull request #1183 from mschneider/size_fix
ZMQ API diverges from POSIX
2014-10-20 23:17:47 +02:00
Pieter Hintjens
0e7458daf3 Merge pull request #1216 from xaqq/pollpri
Add support for POLLPRI flag.
2014-10-18 00:33:20 +02:00
Kapp Arnaud
779c37abc4 Add support for POLLPRI flag.
This commit adds a ZMQ_POLLPRI flag that maps to poll()'s POLLPRI
flag.
This flags does nothing for OMQ sockets. It's only useful for raw
file descriptor (be it socket or file).
This flag does nothing if poll() is not the underlying polling
function. So it is Linux only.
2014-10-17 17:21:41 +02:00
Pieter Hintjens
b6762a6a8b Marked TCP and IPC filters as deprecated (ZAP) 2014-10-14 16:30:20 +02:00
Pieter Hintjens
bc0f8d5168 Updated development master to 4.2.x 2014-10-14 16:30:20 +02:00
Maximilian Schneider
b55288fdf3 return values of socket functions are ssize_t (not int) in compliance with POSIX
deprecated API (zmq_msg_recv/zmq_msg_send) still returns int
2014-09-17 02:44:48 -04:00
Kapp Arnaud
fbdc5aa22d Add const qualifier to source parameters in zmq_z85_decode and zmq_z85_encode 2014-08-14 00:00:00 +02:00
kreuzberger
f042ea9e26 better naming of flags and variables to real functionality: nodrop 2014-08-08 19:45:41 +02:00
kreuzberger
d9a3cc48d4 do not silently drop messages in publisher if hwm is reached 2014-08-08 19:36:00 +02:00
Pieter Hintjens
d4d65da20d Merge pull request #1131 from rodgert/master
Added ZMQ_SHARED message option to zmq_msg_get()
2014-07-12 16:06:26 +02:00
Thomas Rodgers
3497244c41 Added ZMQ_SHARED message option to zmq_msg_get() 2014-07-12 09:01:27 -05:00
Tom Whittock
6099acd2be Ensure EOL is present at end of utils file.
MacOS/Clang complain due to presence of -Wnewline-eof in CZMQ.
2014-07-09 22:45:03 +01:00
Joel Lauener
219310b4f0 Thread scheduling parameters: Use ZMQ context options instead of
environment variables.
2014-07-02 14:41:21 +02:00
Pieter Hintjens
a087ce55ea Problem: two header files for a single library
Users who need e.g. zmq_curve_keypair() have to remember to include
zmq_utils.h, which is counter-intuitive. The whole library should be
represented by a single include file.

Solution: merge all contents of zmq_utils.h into zmq.h, and deprecate
zmq_utils.h. Existing apps can continue unchanged. New apps can ignore
zmq_utils.h completely.
2014-06-27 15:58:18 +02:00
Richard Newton
82be399527 Merge pull request #1097 from hintjens/master
Added capabilities API
2014-06-23 13:23:20 +01:00
Martin Hurton
f06ca69ae9 Add support for SOCKS proxies
This is still raw and experimental.
To connect through a SOCKS proxy, set ZMQ_SOCKS_PROXY socket option on
socket before issuing a connect call, e.g.:

    zmq_setsockopt (s, ZMQ_SOCKS_PROXY,
        "127.0.0.1:22222", strlen ("127.0.0.1:22222"));
    zmq_connect (s, "tcp://127.0.0.1:5555");

Known limitations:
- only SOCKS version 5 supported
- authentication not supported
- new option is still undocumented
2014-06-22 23:19:33 +02:00
Pieter Hintjens
7242cdf842 Trivial whitespace fixup 2014-06-19 14:56:10 +02:00
Pieter Hintjens
f11d673ba9 Problem: need way to probe library capabilities
As libzmq is compiled with optional transports and security mechanisms,
there is no clean way for applications to determine what capabilities
are actually available in a given libzmq instance.

Solution: provide an API specifically for capability reporting. The
zmq_has () method is meant to be open ended. It accepts a string so
that we can add arbitrary capabilities without breaking existing
applications.

zmq.h also defines ZMQ_HAS_CAPABILITIES when this method is provided.
2014-06-18 15:19:07 +02:00
Stoian Ivanov
d5991d6728 merge to upstream 2014-05-12 10:24:31 +03:00
Will Strang
afe5fd87e9 Issue #1017: add ZMQ_HANDSHAKE_IVL time limit on connection handshake 2014-05-09 13:54:24 +00:00
Pieter Hintjens
ded00177b3 Revert "Add code to investigate data race"
This reverts commit 5e0facda17.
2014-05-02 16:50:16 +02:00
Pieter Hintjens
0bc669b106 Merge pull request #1000 from daveab/feature/divide_by_zero_investigation
Feature/divide by zero investigation
2014-05-02 16:31:48 +02:00
dave b
5e0facda17 Add code to investigate data race
Provides control of race windows and logging for some of the interesting transitions.
2014-05-02 14:27:33 +01:00
Stoian Ivanov
fe3e8c5c70 linking fd to pipe identity via socket option 2014-04-30 16:34:55 +03:00
Martin Hurton
f81a1304ff Update function prototype for zmq_msg_gets ()
Added modifiers reflect the following properties:
- zmq_msg_gets () does not mutate property parameter
- zmq_msg_gets () returns a pointer to memory the caller should not
  modify
2014-04-30 13:27:06 +02:00
Martin Hurton
724b2bb844 Add pointer to properties into message structure 2014-04-29 22:37:31 +02:00
Pieter Hintjens
9753de8566 Problem: zmq_socket_monitor code is dirty
Specifically:

* zmq_event_t should not be used internally in libzmq, it was
  meant to be an outward facing structure.

* In 4.x, zmq_event_t does not correspond to monitor events, so
  I removed the structure entirely.

* man page for zmq_socket_monitor is incomplete and the example
  code was particularly nasty.

* test_monitor.cpp needed rewriting, it was not clean.
2014-04-28 11:30:49 +02:00
Chris Busbey
27591d2da6 ZMQ_GSSAPI_PLAINTEXT option for disabling encryption 2014-04-24 14:21:33 -07:00
Chris Busbey
2e1645a519 principle->principal 2014-04-24 14:20:53 -07:00
Chris Busbey
5441db3d7d configurable principle and service principle (for client) 2014-04-24 14:18:58 -07:00
Mike Gatny
4b1c851db4 Stubbed in gssapi security mechanism. 2014-04-24 14:17:05 -07:00
Pieter Hintjens
407b7fb474 Removed duplicate zmq_z85_* methods from zmq.h
Fixes #967
2014-04-10 09:43:16 +02:00
Mark Barbisan
52db50f844 Add the tag name to the zmq_pollitem_t struct to allow easier forward declaration 2014-03-12 10:11:12 -04:00
Pieter Hintjens
305a1442ae Added scaffolding for zmq_msg_gets 2014-03-03 13:19:40 +01:00
Olaf Mandel
e41c8cba0e Rename ZMQ_MAX_SOCKETS_MAX to ZMQ_SOCKET_LIMIT
As per suggestion by Pieter Hintjens. Also update wording in
zmq_ctx_set manual a bit.
2014-02-14 10:09:19 +01:00
Pieter Hintjens
1e9ea54bf6 Merge pull request #889 from olafmandel/MAX_SOCKETS_MAX
Add ZMQ_MAX_SOCKETS_MAX to zmq_ctx_get()
2014-02-13 19:15:01 +01:00
Laurent Alebarde
abf9d8b74e Revert "add a proxy hook"
This reverts commit 9ae6a91fad.
2014-02-13 18:35:09 +01:00
Laurent Alebarde
bc25366f7c Revert "add proxy_chain, a multi proxies chaining in the same thread feature"
This reverts commit bc7441f517.
2014-02-13 18:35:09 +01:00
Olaf Mandel
5815b768b9 Add ZMQ_MAX_SOCKETS_MAX to zmq_ctx_get()
The new options allows querying the maximum allowed number of sockets.
This is system dependent and cannot be encoded in the include file as a
preprocessor macro: for ZMQ_USE_SELECT, this depends on the FD_SETSIZE
macro at time of library compilation, not at time of include file use.
2014-02-13 15:54:06 +01:00
Laurent Alebarde
bc7441f517 add proxy_chain, a multi proxies chaining in the same thread feature 2014-01-28 18:15:01 +01:00
Laurent Alebarde
9ae6a91fad add a proxy hook 2014-01-24 16:52:30 +01:00
Pieter Hintjens
50bd28c037 Cleaned up option to force identity on outgoing connection
- renamed to ZMQ_CONNECT_RID
- fixed whitespace malformating around previous patch
- renamamed next_peer_id to next_rid in preparation for
  larger rename of IDENTITY to ROUTING_ID

Note: ZMQ_CONNECT_RID has no test case and no entry in the man
page, as yet.
2014-01-19 09:27:57 +01:00
Tim M
b1920bdf90 Fixed compile issue with missing member of socket_base. Changed ZMQ_NEXT_IDENTITY to ZMQ_NEXT_CONNECT_PEER_ID.
Fixed case where ZMQ_NEXT_CONNECT_PEER_ID is used in ROUTER, and ROUTER does not read the identity message from the connected pipe.
2014-01-18 17:49:54 -08:00
Tim M
f13512a926 fixed define value in header 2014-01-17 14:41:45 -08:00
Tim M
5d4860ea12 Both STREAM and ROUTER sockets suffer from a naming problem on outbound connections. While these connections can be created, they can't be immediately used. Traffic must be received before it can be sent. This prevents practical, minimal usage of STREAM or ROUTER as a true N fan in/out socket.
This change simply provides the user with a socket option that sets a user defined name of the next outbound connection:

zmq_setsockopt(routerSock,ZMQ_NEXT_IDENTITY,"myname",6);
if(0 > zmq_connect(routerSock,"tcp://127.0.0.1:1234")) return 1;
ret = zmq_send(routerSock,"myname",6,ZMQ_SNDMORE);
zmq_send(routerSock,b.mem,b.used,0);

In this example, the socket is immediately given the name "myname", and is capable of immediately sending traffic.

This approach is more effective in three ways:
1) It prevents all sorts of malicious peer naming attacks that can cause undefined behavior in existing ROUTER connections. (Two connections are made that both transmit the same name to the ROUTER, the ROUTER behavior is undefined)
2) It allows immediate control of connections made to external parties for STREAM sockets. Something that is not possible right now. Before an outbound connection had no name for STREAM or ROUTER sockets because outbound connections cannot be sent to without first receiving traffic.
3) It is simpler and more general than expecting two ROUTER sockets to handshake on assigned connection names. Plus it allows inline sending to new connections on ROUTER.
2014-01-17 14:34:39 -08:00
Stefan Radomski
3aeaa6fab1 ZMQ_SRCFD docs and tests
Also moved the fd field from message content to message itself
2014-01-07 01:09:51 +01:00
Stefan Radomski
f30fb8501e Expose remote FD via zmq_msg_get(&msg, ZMQ_SRCFD)
This patch allows client applications to retrieve the remote endpoint from a message that originated from a tcp socket
2014-01-06 10:31:42 +01:00
Pieter Hintjens
b3b9e046ee Updated copyright statements for 2014 2014-01-02 12:00:57 +01:00
Pieter Hintjens
5bf96f64b0 Removed ZMQ_ZAP_IPC_CREDS option
- This seems redundant; is there a use case for NOT providing
  the IPC credentials to the ZAP authenticator?

- More, why is IPC authentication done via libzmq instead of ZAP?
  Is it because we're missing the transport type on the ZAP request?
2014-01-01 17:39:14 +01:00
Brandon Carpenter
a018ef5e86 Add support for extending ZAP request address with IPC peer credentials.
Another take on LIBZMQ-568 to allow filtering IPC connections, this time
using ZAP.  This change is backward compatible.  If the
ZMQ_ZAP_IPC_CREDS option is set, the user, group, and process IDs of the
peer process are appended to the address (separated by colons) of a ZAP
request; otherwise, nothing changes.  See LIBZMQ-568 and zmq_setsockopt
documentation for more information.
2013-12-06 14:28:44 -08:00
Brandon Carpenter
dc9b1309b9 Shortened ZMQ_IPC_ACCEPT_FILTER_[UGP]ID to ZMQ_IPC_FILTER_[UGP]ID. 2013-12-06 09:58:10 -08:00
Brandon Carpenter
2252322acc Add IPC accept filter socket options.
Adds ZMQ_IPC_ACCEPT_FILTER_{PID,UID,GID} socket options to add processs,
user, and group IDs to the IPC filter sets. Fixes LIBZMQ-568.
2013-12-04 14:23:13 -08:00
Chris Laws
38bceca9ca Add ability to set and get DSCP socket option 2013-11-25 13:31:21 +10:30
Pieter Hintjens
75a293d379 Moved version macros to top for better visibility 2013-11-24 12:47:24 +01:00
Richard Newton
7c51429440 Reduce default maximum number of sockets by 1 so there is room for the reaper socket. 2013-11-11 13:41:42 +00:00
Mark Barbisan
5e71475d45 Shorten ZMQ_ROUTER_REASSIGN_IDENTITIES to ZMQ_ROUTER_HANDOVER. Also, added a test for the HANDOVER functionality. 2013-11-01 00:03:00 -04:00