Commit Graph

495 Commits

Author SHA1 Message Date
Michael
05b5633b8d update for mingw's default _WIN32_WINNT
mingw defaults with _WIN32_WINNT as 0x0502 which doesn't define inet_pton(), so add a conditional check
2016-02-06 23:01:26 +11:00
Michael
596fd2408a added ZMQ_HAVE_WINDOWS check to _WIN32_WINNT usage 2016-02-06 22:59:58 +11:00
Michael
b98b1495af added ZMQ_HAVE_WINDOWS check to _WIN32_WINNT usage 2016-02-06 22:59:13 +11:00
Michael
595181d301 added ZMQ_HAVE_WINDOWS check to _WIN32_WINNT usage 2016-02-06 22:58:38 +11:00
Luca Boccassi
84ad4bf0ff Problem: cannot use new pre-allocated FD with TCP
Solution: parse the value set by the ZMQ_PRE_ALLOCATED_FD sockopt
when creating a new TCP socket and use it if valid.
Add new tests/test_pre_allocated_fd_tcp.cpp unit test.
2016-02-04 16:57:26 +00:00
Luca Boccassi
9b885b7c00 Problem: cannot use new pre-allocated FD with IPC
Solution: parse the value set by the ZMQ_PRE_ALLOCATED_FD sockopt
when creating a new IPC socket and use it if valid.
Add new tests/test_pre_allocated_fd_ipc.cpp unit test.
2016-02-04 16:57:26 +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
Pieter Hintjens
44c6b0484e Revert "Revert "Problem: deprecated use and reference of zmq_term"" 2016-02-01 23:00:06 +01:00
Pieter Hintjens
1708bfefb7 Revert "Problem: deprecated use and reference of zmq_term" 2016-02-01 22:41:51 +01:00
Constantin Rack
0d171563d0 Problem: tests use deprecated zmq_term function
Solution: replace all occurrences with `zmq_ctx_term`
2016-02-01 21:40:24 +01: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
somdoron
389e853c6d Fix compilation errors on windows 2016-01-30 13:29:41 +02:00
Doron Somech
add4e7675f Merge pull request #1744 from jcfr/fix-gcc-warnings
Fix unused-parameter/unused-but-set-variable/missing-field-initializers warnings
2016-01-30 09:08:09 +01:00
Jean-Christophe Fillion-Robin
46b02338e3 Style: Fix -Wunused-but-set-variable in test_stream_exceeds_buffer.cpp
This commit addresses the following warnings reported on gcc 5.2.1. In
the future, this will help reduce the "noise" and help catch warnings
revealing a serious problem.

8<---8<---8<---8<---8<---8<---8<---8<---8<---8<---8<---8<---8<---
/path/to/libzmq/tests/test_stream_exceeds_buffer.cpp: In function ‘int main()’:
/path/to/libzmq/tests/test_stream_exceeds_buffer.cpp:19:9: warning: variable ‘rc’ set but not used [-Wunused-but-set-variable]
     int rc = setsockopt(server_sock, SOL_SOCKET, SO_REUSEADDR, &enable, sizeof(enable));
         ^
8<---8<---8<---8<---8<---8<---8<---8<---8<---8<---8<---8<---8<---
2016-01-30 02:56:03 -05:00
Jean-Christophe Fillion-Robin
f329252dcb Style: Fix unused parameter compilation warnings
This commit addresses the following warnings reported on gcc 5.2.1. In
the future, this will help reduce the "noise" and help catch warnings
revealing a serious problem.

8<---8<---8<---8<---8<---8<---8<---8<---8<---8<---8<---8<---8<---
/path/to/libzmq/src/options.cpp:1048:36: warning: unused parameter ‘option_’ [-Wunused-parameter]
 bool zmq::options_t::is_valid (int option_) const
                                    ^

/path/to/libzmq/src/plain_client.cpp:146:30: warning: unused parameter ‘cmd_data’ [-Wunused-parameter]
         const unsigned char *cmd_data, size_t data_size)
                              ^

/path/to/libzmq/src/plain_client.cpp:146:30: warning: unused parameter ‘cmd_data’ [-Wunused-parameter]
         const unsigned char *cmd_data, size_t data_size)
                              ^

/path/to/libzmq/src/socket_base.cpp:1445:44: warning: unused parameter ‘group_’ [-Wunused-parameter]
 int zmq::socket_base_t::xjoin (const char *group_)
                                            ^
/path/to/libzmq/src/socket_base.cpp:1451:45: warning: unused parameter ‘group_’ [-Wunused-parameter]
 int zmq::socket_base_t::xleave (const char *group_)
                                             ^

/path/to/libzmq/src/radio.cpp:145:33: warning: unused parameter ‘msg_’ [-Wunused-parameter]
 int zmq::radio_t::xrecv (msg_t *msg_)
                                 ^
/path/to/libzmq/src/dish.cpp:164:32: warning: unused parameter ‘msg_’ [-Wunused-parameter]
 int zmq::dish_t::xsend (msg_t *msg_)
                                ^

/path/to/libzmq/tests/test_msg_ffn.cpp:32:16: warning: unused parameter ‘data’ [-Wunused-parameter]
 void ffn(void *data, void *hint) {
                ^

/path/to/libzmq/tests/test_timers.cpp:50:19: warning: unused parameter ‘timer_id’ [-Wunused-parameter]
 void handler (int timer_id, void* arg)
                   ^
8<---8<---8<---8<---8<---8<---8<---8<---8<---8<---8<---8<---8<---
2016-01-30 02:56:03 -05:00
Jean-Christophe Fillion-Robin
05e48cc6a9 ctest: Add missing test_udp and test_large_msg
This commit fixes the author warnings reported below. These tests
have originally been introduced in zeromq/libzmq@5ebfd17 and
zeromq/libzmq@5fe75f0.

8<---8<---8<---8<---8<---8<---8<---8<---8<---8<---8<---
CMake Warning (dev) at tests/CMakeLists.txt:133 (message):
  Test 'test_udp' is not known to CTest.
This warning is for project developers.  Use -Wno-dev to suppress it.

CMake Warning (dev) at tests/CMakeLists.txt:133 (message):
  Test 'test_large_msg' is not known to CTest.
This warning is for project developers.  Use -Wno-dev to suppress it.
8<---8<---8<---8<---8<---8<---8<---8<---8<---8<---8<---
2016-01-30 02:10:01 -05:00
somdoron
5ebfd1728f make udp support for radio-dish 2016-01-29 21:17:11 +02:00
somdoron
1960b4e8a9 Filtering messages on dish side 2016-01-29 10:53:47 +02:00
somdoron
5054f2eb61 radio-dish is sending the group as first frame 2016-01-29 10:53:47 +02:00
somdoron
68675e23d9 adds group to zmq_msg 2016-01-29 10:53:42 +02:00
somdoron
dc945998a4 missing virtual modifier or session_base 2016-01-28 18:31:05 +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
Constantin Rack
5c9bd5f0cb Problem: SIZE_MAX is not defined in all stdint.h includes
Solution: remove debug printf line completely
2016-01-20 19:30:21 +01:00
Constantin Rack
b7d42a4c4b Problem: SIZE_MAX is not defined
Solution: include stdint.h
2016-01-20 19:18:00 +01:00
Min RK
5fe75f0e43 truncate rc to INT_MAX
to avoid overflow for large messages

send/recv still succeed for large messages,
but `zmq_msg_size` must be used to get the true size.
2016-01-20 13:43:51 +01:00
somdoron
669c5697c2 fixing a bug: client over inproc receives msg with routing id set 2016-01-19 20:18:04 +02:00
Anonymous Maarten
be36423bc2 Problem: On Windows CI, the included file Windows.hpp could not be
found.
Solution: Include the source directory

Problem: _sleep is a library function of Windows.
Solution: use sleep_
2016-01-14 02:53:24 +01:00
Frederic Tregon
9bdb60577c Test for issue #1690 (ZMQ_REQ_RELAXED)
Current ZMQ_REQ_RELAXED test improvement to check that pipes are not closed
after executing two send() in a row with no recv() in between.
2016-01-03 15:28:07 +01:00
Pieter Hintjens
2566c02a9e Problem: CLIENT and SERVER don't check SNDMORE
These sockets don't handle multipart data, so if callers send it,
they drop frames, and things break silently.

Solution: if the caller tries to use ZMQ_SNDMORE, return -1 and
set errno to EINVAL.
2015-12-29 17:00:06 +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
Fedor Sheremetyev
234018d749 Add test demostrating that HWM applies to messages that have been already consumed. 2015-11-24 17:33:19 +00:00
Constantin Rack
5ba328d7f3 Problem: there is no test for setsockopt ZMQ_TCP_SEND/RECV_BUFFER
Solution: add test case
2015-11-13 10:44:00 +01:00
Anonymous Maarten
9930f1fc20 CTest: add missing tests + check for unknown tests 2015-10-24 00:17:52 +02:00
Anonymous Maarten
55ca9c5654 CMake: use libsodium if available, else use tweet_nacl 2015-10-23 04:06:57 +02: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
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
Richard Newton
3f4f3c1137 Fix windows cmake build 2015-09-14 13:21:20 +01:00
Constantin Rack
2c94bb42c5 Merge pull request #1578 from hintjens/master
Problem: drop tests on CLIENT/SERVER are misleading
2015-09-13 14:18:49 +02:00
Pieter Hintjens
50859e40b9 Problem: drop tests on CLIENT/SERVER are misleading
These sockets deal only with single part data (at present), so the
drop tests are misleading / inappropriate.

Solution: remove them.
2015-09-13 12:17:53 +02:00
Joe Eli McIlvain
fb57110b94 Merge pull request #1577 from hintjens/master
Various cleanups for CLIENT-SERVER sockets
2015-09-11 14:24:51 -07:00
Pieter Hintjens
6b00f40f74 Problem: test_client/server_drop_more are invalid
These tests connected CLIENT and SERVER to DEALER... this isn't
allowed. I changed to CLIENT-to-SERVER in both cases. The result
was aborts in client.cpp and server.cpp which cannot handle
invalid multipart data.

I removed the asserts in each of these in xsend.

Solution: fix the test cases and remove the (unwanted?) asserts
in client.cpp:xsend and server.cpp:xsend.
2015-09-11 17:07:50 -04:00
Pieter Hintjens
c2dffb9908 Problem: threadsafe test uses CLIENT-to-CLIENT
Solution: fix to use CLIENT-to-SERVER and increase number of messages
sent to 100K per thread, to better stress thread safety.
2015-09-11 17:01:27 -04:00
Pieter Hintjens
d416ffcec5 Problem: cannot build single test case in tests
This is due to the mangled include of platform.h, which was to make
CMake happy.

Solution: in CMakeLists.txt, define USING_CMAKE and then look for
platform.h in current directory if that is defined, else look in
../src/ as one would expect.
2015-09-11 16:42:26 -04: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