0
0
mirror of https://github.com/zeromq/libzmq.git synced 2025-01-04 13:05:41 +08:00

1460 Commits

Author SHA1 Message Date
Pieter Hintjens
dc09da4569 Return EFAULT if required arguments are null 2012-02-16 12:25:17 -06:00
Mikko Koppanen
2f44faa7ce Merge pull request #247 from pieterh/sendrecv
Added zmq_msg_send/recv functions
2012-02-16 08:58:03 -08:00
Mikko Koppanen
2b646cbf63 Merge pull request #249 from pieterh/msgpeekpoke
Renamed zmq_getmsgopt to zmq_msg_get
2012-02-16 08:56:29 -08:00
Pieter Hintjens
d092f2615c Renamed peek/poke to get/set 2012-02-15 19:28:29 -06:00
Pieter Hintjens
dcc1725a90 Renamed zmq_getmsgopt to zmq_msg_peek
* Added zmq_msg_poke for orthogonality
* Added zmq_msg_more for simplicity
* Fixed up man pages and test program
2012-02-15 18:44:28 -06:00
Pieter Hintjens
fb4748f257 Added zmq_msg_send/recv functions 2012-02-15 15:37:35 -06:00
Chuck Remes
b2e2fa622d Merge pull request #244 from pieterh/master
Cleanups to man pages
2012-02-15 08:54:27 -08:00
Pieter Hintjens
0c4a19c408 Deprecated XREQ/XREP 2012-02-15 10:48:31 -06:00
Pieter Hintjens
5f6b95f4a2 Fixed footers to refer to man page, not all docs 2012-02-15 10:39:18 -06:00
Pieter Hintjens
c85ecfc066 Cleaned up description of multi-part messages 2012-02-15 10:39:18 -06:00
Pieter Hintjens
636de46fe1 Removed section on devices, added new methods 2012-02-15 10:39:18 -06:00
Pieter Hintjens
086c059430 Ported numerous fixes from 2.1 man page 2012-02-15 10:39:18 -06:00
Chuck Remes
9bc0e10818 Merge pull request #243 from pieterh/master
Fixed error in documentation build
2012-02-15 07:33:03 -08:00
Pieter Hintjens
bd4f703264 Ignored generated files 2012-02-15 09:27:42 -06:00
Pieter Hintjens
2000d44109 Fixed syntax error in zmq_getsockopt man page 2012-02-15 09:26:39 -06:00
Pieter Hintjens
a50a8aa364 Revert "more checks for parameters of API functions"
This reverts commit e646ce43c155f9710aa4486abd2daf6d4a30ca5b.
2012-02-14 18:43:33 -06:00
Pieter Hintjens
afe8cd503f Revert "fix warn unused"
- anonymous contributor

This reverts commit 7b7d404269cc9bb28e1954ed38dbeb8f63079fd1.
2012-02-14 18:43:33 -06:00
Pieter Hintjens
b2e9347372 Merge pull request #238 from ianbarber/master
Wildcard support in TCP and IPC addresses
2012-02-14 16:39:32 -08:00
Ian Barber
cc10c00193 Updating docs with new sockopt 2012-02-14 23:14:33 +00:00
Ian Barber
b6c97230ed Merge branch 'master' of https://github.com/zeromq/libzmq 2012-02-14 23:10:15 +00:00
Ian Barber
b5d3373905 Moving to std::string in options 2012-02-14 23:10:06 +00:00
Pieter Hintjens
a908ccbf35 Merge pull request #241 from skaller/master
provide type safe sockets and contexts
2012-02-13 08:55:58 -08:00
Pieter Hintjens
48423c9e40 Merge pull request #242 from niXman/master
more checks for parameters of API functions
2012-02-13 08:35:59 -08:00
niXman
e646ce43c1 more checks for parameters of API functions 2012-02-12 20:10:52 +04:00
skaller
4807935605 Implement type safe sockets and contexts. 2012-02-12 10:15:51 +11:00
Ian Barber
770f84331f Allowing value 0, and moving code to get_address functions based on feedback 2012-02-11 15:09:03 +00:00
Ian Barber
91bf4944da Merge branch 'master' of https://github.com/zeromq/libzmq 2012-02-11 15:08:23 +00:00
Chuck Remes
256fa5d2b8 Merge pull request #240 from niXman/master
fix warn unused variables
2012-02-11 06:10:50 -08:00
niXman
7b7d404269 fix warn unused 2012-02-10 13:39:34 +04:00
Pieter Hintjens
40052c1251 Merge pull request #239 from skaller/master
Provide scatter/gather array I/O
2012-02-10 00:20:56 -08:00
Ian Barber
7fa14f3823 Merge branch 'master' of https://github.com/zeromq/libzmq 2012-02-08 22:06:50 +00:00
Ian Barber
7b32c9cb51 Adding ZMQ_LAST_ENDPOINT for wildcard support on TCP and IPC sockets 2012-02-08 22:06:46 +00:00
skaller
c3f7543ebe Fix uio support.
We have to use an incomplete type in the interface.
The definition of iovec is only in the implementation.
This appears to following existing practice in 0MQ.
It seems a bit flakey that zmq.h is not included in zmq.cpp,
which is normal practice to ensure the implementation matches
the specified interface. YMMV. I follow 0MQ style.
2012-02-08 13:15:47 +11:00
skaller
970a005399 Provide interface.
Also move iovec definition from implementation to interface.
Not clear to me at present if an incomplete type should
be used to avoid gratuitously including <sys/uio.h> in
the interface. The interface can't be used with this include.
2012-02-08 12:58:35 +11:00
skaller
383a49dadf Implement zmq_recvmmsg. 2012-02-08 11:45:36 +11:00
skaller
531835bba8 Implement zmq_sendv.
Posix style send multiple messages using scatter/gather array.
2012-02-08 03:20:25 +11:00
skaller
f59fff7bf2 Add check for sys/uio.h to configure script.
sys/uio.h contains the XSI vector I/O data structure.
2012-02-08 02:47:51 +11:00
Pieter Hintjens
21571cf085 Merge pull request #237 from skaller/master
Fix comments to conform to style guide.
2012-02-04 02:47:10 -08:00
skaller
81662d70be Add a test for thread safe sockets. 2012-02-04 15:13:36 +11:00
skaller
759b2e01fd Fix comments to conform to style guide. 2012-02-04 12:34:06 +11:00
Pieter Hintjens
9dab56c1df Merge pull request #235 from skaller/master
Thread Safe Sockets.
2012-02-03 12:40:05 -08:00
Pieter Hintjens
cbf6126b08 Merge pull request #234 from ianbarber/master
Semicolon missing
2012-02-03 12:39:47 -08:00
Pieter Hintjens
935f17488a Merge pull request #236 from danielnorberg/master
add missing semicolon
2012-02-03 12:39:11 -08:00
Daniel Norberg
67fd4c9a2c add missing semicolon 2012-02-03 17:28:45 +01:00
skaller
520ad3c2d7 Set and arrange propagation of thread safe sockets flag.
We use a distinct context initialisation function to specify
all sockets derived therefrom will be thread safe.

However the inheritance is done exclusively in the C interface.
This is not really correct, but it is chosen to minimise
interference with the existing C++ code, including any
construct or other calls within the C++ code base.
Semantically the C++ code should be unchanged,
physically some data structures and extra methods are
provided by they're only used from the C binding.
2012-02-04 02:17:35 +11:00
skaller
988efbc73a Thread Safe Sockets.
1. Reorganise C API socket functions to eliminate bad practice
of public functions calling other public functions. This should
be done for msg's too but hasn't been in this patch.

2. Reorganise code in C API socket functions so that the
socket is cast on one line, the C++ function called on
the next with the result retained, then the result is returned.

This makes the code much simpler to read and also allows
pre- and post- call hooks to be inserted easily.

3. Insert pre- and post- call hooks which set and release
a mutex iff the thread_safe flag is on.

4. Add the thread_safe_flag to base_socket_t initialised to
false to preserve existing semantics. Add an accessor for
the flag, add a mutex, and add lock and unlock functions.

Note: as yet no code to actually set the flag.
2012-02-04 01:41:09 +11:00
skaller
4dd6ce0639 Add mission ; character 2012-02-04 00:10:01 +11:00
Ian Barber
43b71ae4bf Fixing missing semicolon in xpub.cpp as reported on the list by Emmanuel TAUREL 2012-02-03 12:44:19 +00:00
Pieter Hintjens
dc50bf5dca Merge pull request #233 from danielnorberg/master
LIBZMQ-300: free received subscription messages
2012-02-03 02:12:09 -08:00
Daniel Norberg
79f753bf56 xpub: free received subscription messages 2012-02-03 11:04:46 +01:00
Chuck Remes
4f4d72afc6 Merge pull request #232 from chuckremes/master
mato: merge patch to close libzmq-268
2012-02-02 12:22:46 -08:00
Chuck Remes
93db782a1d Merge branch 'libzmq-268' of git://git.lucina.net/libzmq 2012-02-02 14:17:30 -06:00
Chuck Remes
adee8270dd Merge pull request #231 from chuckremes/master
mato: merge patch to close libzmq-303
2012-02-02 12:16:32 -08:00
Chuck Remes
762bcff73f Merge branch 'libzmq-303' of git://git.lucina.net/libzmq 2012-02-02 14:14:56 -06:00
Chuck Remes
e89a5f1e1a Merge pull request #230 from chuckremes/master
mato: merge patch to close libzmq-205
2012-02-02 12:14:27 -08:00
Chuck Remes
c54ad48c9b Merge branch 'libzmq-205' of git://git.lucina.net/libzmq 2012-02-02 14:09:37 -06:00
Martin Lucina
0319cb2cd1 Fix data loss for PUB/SUB and unidirectional transports (LIBZMQ-268)
With the introduction of subscription forwarding, the first message sent
on a PUB socket using a unidirectional transport (e.g. PGM) is always
lost due to the "subscribe to all" being done asynchronously.

This patch fixes the problem and also refactors the code to have a single
point where the "subscribe to all" is performed.

Signed-off-by: Martin Lucina <martin@lucina.net>
2012-02-02 13:07:48 +01:00
Pieter Hintjens
edf7db74d9 Merge pull request #227 from gimaker/smaller-mtrie
Reduce memory usage of mtrie.
2012-01-30 01:28:47 -08:00
Staffan Gimåker
e6c97c5ecc Reduce memory usage of mtrie.
Signed-off-by: Staffan Gimåker <staffan@spotify.com>
2012-01-30 09:47:33 +01:00
Martin Lucina
1925c92fe9 Merge branches 'libzmq-205' and 'libzmq-303' 2012-01-30 01:57:18 +01:00
Pieter Hintjens
7e8a839a22 Merge pull request #226 from gitfoxi/master
Support Epoll on cross-compile without runtime test.
2012-01-27 16:01:20 -08:00
m
1e5a48f521 Epoll is default for cross-compile. For regular-compile, test kernel (run) support. 2012-01-27 15:24:47 -08:00
Pieter Hintjens
281dcd2544 Merge pull request #221 from fidlej/master
Updated connector open() doc strings.
2012-01-27 14:48:43 -08:00
Pieter Hintjens
676d4f4e18 Merge pull request #222 from gimaker/trie-pruning
Fix for LIBZMQ-305
2012-01-27 14:48:17 -08:00
Pieter Hintjens
0c94cd036a Merge pull request #223 from gimaker/libzmq-310
Throw away unexpected data received by XPUB sockets, rather than asserting
2012-01-27 14:47:36 -08:00
Pieter Hintjens
95f6a07403 Merge pull request #224 from vortechs2000/master
Patch from Mikko Koppanen for #LIBZMQ-301
2012-01-27 14:47:14 -08:00
Pieter Hintjens
57f64c5079 Merge pull request #225 from gitfoxi/master
Fix build on old-ass Linux
2012-01-27 14:44:42 -08:00
m
c71375ea72 Fix: Case where system library has epoll but kernel does not support it. 2012-01-27 13:27:21 -08:00
m
c4f2240851 Fix: runtime patch for when system has clock_gettime but does not support CLOCK_MONOTONIC. 2012-01-27 12:40:56 -08:00
m
b5dbff8ed4 Fix basic_string<unsigned char> not implemented in stdc++ 3 2012-01-27 12:24:14 -08:00
m
99df984be1 Fix bad combination of gcc3, -Werror and private destructor. 2012-01-27 12:23:32 -08:00
Staffan Gimåker
bc4d1b6002 Fixed segfault bug sometimes happening when pruning the trie/mtrie.
The cause behind the segfault was next.node being deleted but count still
being non-zero.

Signed-off-by: Staffan Gimåker <staffan@spotify.com>
2012-01-26 14:12:11 +01:00
AJ Lewis
2e0c4330fa Patch from Mikko Koppanen for #LIBZMQ-301
Add the '-Ae' flag and check for gethrtime() on HPUX

Check if CLOCK_MONOTONIC defined before using it - if not, use
gethrtime() if it's available, otherwise fall back to the old
behavior.

Signed-off-by: AJ Lewis <aj.lewis@quantum.com>
2012-01-19 13:09:23 -06:00
Staffan Gimåker
36215656eb Throw away unexpected data received by XPUB sockets, rather than asserting.
Fixes LIBZMQ-310.

Signed-off-by: Staffan Gimåker <staffan@spotify.com>
2012-01-09 12:19:59 +01:00
Martin Lucina
c34a144365 Fix pgm_receiver.cpp: zmq_assert (pending_bytes == 0) (LIBZMQ-205)
This patch fixes the problem described in LIBZMQ-205. The assertion itself
is probably caused by previously queued POLLIN events arriving after POLLIN
has been disabled on the socket.

The following additional bugs have been fixed as part of debugging this
problem:

- pgm_receiver_t does not flush messages written to the session in all
  cases which can lead to a stalled reader. Add calls to session->flush ()
  in the appropriate places.

- ensure to restart polling when a pending message is flushed in
  activate_in ().

Signed-off-by: Martin Lucina <martin@lucina.net>
2012-01-04 11:48:41 +01:00
Staffan Gimåker
19129edc60 Prune redundant nodes in the trie.
Signed-off-by: Staffan Gimåker <staffan@spotify.com>
2012-01-03 16:24:44 +01:00
Staffan Gimåker
6fa9ffebe5 Prune redundant nodes in the mtrie.
Signed-off-by: Staffan Gimåker <staffan@spotify.com>
2012-01-03 16:24:16 +01:00
Martin Lucina
029e28865d Fix assertion in pgm_sender_t::plug() (LIBZMQ-303)
Opening any PGM socket gives this assertion. The problem is in
pgm_sender_t::plug() which is incorrectly testing the return value from
session::write().

Signed-off-by: Martin Lucina <martin@lucina.net>
2011-12-25 02:57:04 +01:00
Ivo Danihelka
1d8b132d36 Updated connector open() doc strings.
Signed-off-by: Ivo Danihelka <ivo@danihelka.net>
2011-12-21 16:33:16 +01:00
Martin Sustrik
6f32361fea Version bumped to 3.1.1
Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2011-12-19 15:43:38 +01:00
Martin Lucina
b3fbe0113d Merge branch 'master' of github.com:zeromq/libzmq 2011-12-18 12:46:03 +01:00
Martin Sustrik
dcb1d558a5 Fix MSVC10 build distfiles
Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
v3.1.0
2011-12-18 12:30:31 +01:00
Martin Sustrik
3bf7860fb7 NEWS updated for 3.1.0 release
Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2011-12-18 11:41:45 +01:00
Martin Lucina
22ef966d4a Update email address in man pages
Signed-off-by: Martin Lucina <martin@lucina.net>
2011-12-18 11:19:55 +01:00
Martin Lucina
183e126364 Fix typo in zmq_sendmsg(3) manual page
Signed-off-by: Martin Lucina <martin@lucina.net>
2011-12-18 11:12:44 +01:00
Martin Lucina
adc07128e6 Merge branch 'master' of github.com:zeromq/libzmq 2011-12-18 11:06:19 +01:00
Martin Sustrik
3fbe8ac3c3 Dont wait for pending subscription commands on shutdown
When (X)SUB socket is being shut down there may be pending
outbound subscription commands in the pipes. In such case
we want to close the socket immediately instead of waiting
for the commands to be sent.

Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2011-12-17 23:42:45 +01:00
Martin Lucina
bfbd16d099 Merge branch 'master' of github.com:zeromq/libzmq 2011-12-17 11:59:29 +01:00
Martin Sustrik
91fdedf25c Fix polling on XREP socket
When polling on XREP socket in incoming message part was prefetched,
but not the identity of sender. The problem is fixed by this patch.

Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2011-12-17 10:14:32 +01:00
Martin Sustrik
f9eb763293 zmq_sendmsg and zmq_recvmsg checks for NULL message object
Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2011-12-16 07:04:38 +01:00
Stuart Webster
3fb5c11b03 Added MSVC10 solution and project files for Windows
These include configurations for both Win32 and x64 platforms. All project
settings have been normalised in property sheets (the ".props" files under
builds/msvc/properties) to simplify maintenance. Build artefacts are all
generated in platform-specific subfolders of bin, lib and obj directories.

Also enables the use of precompiled headers with MSVC10.

This significantly reduces the time required to compile libzmq with Visual
Studio on Windows. It should have no impact on other platforms.

Signed-off-by: Stuart Webster <sw_webster@hotmail.com>
2011-12-15 14:03:43 +01:00
Martin Lucina
a9e03336b0 A synchronous connect() failure in ipc_connecter can result in Assertion
failed: s == retired_fd (ipc_connecter.cpp:174), as reported in LIBZMQ-294.

This patch fixes the bug, and also an identical problem in tcp_connecter
which has not hit people since TCP connect() usually completes via the
asynchronous code path (poll, out_event).

Signed-off-by: Martin Lucina <martin@lucina.net>
2011-12-15 13:23:40 +01:00
Martin Lucina
82d935309e Fix synchronous connect failure for ipc://, tcp:// (LIBZMQ-294)
A synchronous connect() failure in ipc_connecter can result in Assertion
failed: s == retired_fd (ipc_connecter.cpp:174), as reported in LIBZMQ-294.

This patch fixes the bug, and also an identical problem in tcp_connecter
which has not hit people since TCP connect() usually completes via the
asynchronous code path (poll, out_event).

Signed-off-by: Martin Lucina <martin@lucina.net>
2011-12-14 00:00:32 +01:00
Martin Lucina
c90f54e6a6 Merge branch 'master' of github.com:zeromq/libzmq 2011-12-11 23:09:48 +01:00
Martin Sustrik
e7d748e812 Mika Fischer added to AUTHORS file
Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2011-12-03 13:27:20 +01:00
Martin Sustrik
0df86c41b5 rt library required on all platforms
Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2011-12-03 13:25:44 +01:00
Mika Fischer
aaac96d94a This makes clock_t insensitive to the system clock being reset by NTP or
the sysadmin, which could previously cause long hangs for instance in
zmq_poll.

Signed-off-by: Mika Fischer <mika.fischer@zoopnet.de>
2011-12-03 13:07:30 +01:00
Martin Lucina
b4f5ee58a9 Merge branch 'master' of github.com:zeromq/libzmq 2011-11-30 19:34:11 +01:00
Martin Sustrik
fc17bd4117 ENOTCONN on recv() on TCP socket is treated decently (issue 254)
Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2011-11-22 14:48:35 +01:00
Martin Sustrik
daac9ac5b2 Phillip Kovacs added to the AUTHORS file
Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2011-11-21 08:11:33 +01:00