Harald Nøkland
4815c80aed
Fix two issues in message_t's range constructor
...
Fix the following two problems in message_t's range constructor: (1) The range constructor passed the wrong size for iterator-types larger than one byte, (2) The range constructor didn't compile for const-iterators.
2015-11-30 15:36:42 +01:00
gdfast
c1e8ac0f19
Make getsockopt() functions const
...
Make the socket_t::getsockopt() functions (which wrap zmq_getsockopt() ) const because they should only access and not modify socket state.
2015-11-19 12:37:07 -05:00
dquam
baeaebc1cf
Fix usage of zmq_msg_recv and zmq_recvmsg
...
The zmq_msg_recv() function takes the message, socket, and flags while the zmq_recvmsg() function takes the socket, message. This commit addresses that difference.
2015-11-12 15:35:16 -06:00
Constantin Rack
7c3d374ff8
Merge pull request #57 from gdfast/patch-1
...
Avoid using deprecated function zmq_recvmsg
2015-11-10 21:20:22 +01:00
Constantin Rack
fadb37e4a7
Merge pull request #52 from revaultch/master
...
Fixes assertion error: src/mutex.hpp:123
2015-11-10 21:20:11 +01:00
gdfast
5989203558
Avoid using deprecated function zmq_recvmsg
...
The zmq_recvmsg() function has been replaced by zmq_msg_recv() since version 3.2.0, and has since been marked as deprecated.
See: https://raw.githubusercontent.com/zeromq/zeromq3-x/master/NEWS
Replace our uses of the old function (which was in monitor_t::monitor()) with the more modern function call. Support backwards compatibility with a #DEFINE macro for versions of zmq preceeding 3.2.0
2015-11-10 15:14:21 -05:00
Christopher D. McMurrough
0feecde95c
fixed type mismatch warnings (size_t to int)
...
MSVC complains about conversion of size_t to int. The size_t typedef is
defined as an unsigned __int64 on Win64, which triggers the warning. Two
such instances were fixed with static_cast<int>(size_t)
2015-11-05 17:21:24 -06:00
Jim Hague
87b12c806a
Extend C++11 guard to cover remaining use of std::vector data().
...
Now compiles without error with a pre-C++11 compiler (g++-3.3).
Fixes #53
Please enter the commit message for your changes. Lines starting
2015-11-01 16:08:56 +00:00
Urs Keller
971092e472
Fixes assertion error, when destroing ctx while creating a socket from a different thread: ./src/mutex.hpp:123
2015-10-02 16:32:36 +02:00
Spyros Ligouras
05a0256d0e
Fix backward compatibility
2015-09-26 13:20:37 +03:00
jens
34c8e4395c
Fixed some const-correctness issues
...
C++11-ified some stuff:
overloads with C++11 types, nothrow
Added some template methods to work with messages and sockets
2015-07-05 13:29:03 +02:00
Todd Neal
67b216681d
Add an rvalue overload for socket_t::send
...
This lets you create functions that return message_t's by value, and
pass them to send() with no copy.
2015-03-05 16:06:36 -06:00
Todd Neal
f141cf5bfc
Fix a misaligned load
...
The issue was discovered by clang:
zmq.hpp:504:34: runtime error: load of misaligned address 0x2b38beb224b2
for type 'int32_t' (aka 'int'), which requires 4 byte alignment
I modified the loads of both event and value to be consistent.
2015-03-05 08:19:13 -06:00
Pieter Hintjens
7f6cc85df8
Problem: zmq_event_t removed in libzmq v4.1
...
Solution: define this if we need it, so that caller can use it
on all versions of libzmq.
Fixes #40
2014-09-11 08:32:58 +02:00
zbierak
a819813095
Fixes backward compatibility with zmq 3.x
...
The code added in 'Fixed misaligned structure cast' implicitly assumes zmq 4.x, since it relies on new fields in zmq_event_t structure. This commit re-introduces the previous code if zmq < 4.x is detected.
2014-08-08 08:18:16 +00:00
Justin Boswell
0c0f3ae451
Fixed misaligned structure cast
...
zmq_event_t is often padded (due to a uint16_t as its first member), and thus you cannot re-interpret bytewise packed message buffers as zmq_event_t, it must be read manually. This was resulting in the value always being garbage, which is troublesome if you wish to inspect a SOCKET, for example.
2014-08-06 14:49:59 -04:00
Cosmo Harrigan
04d2897605
Fix for #34
...
As of right now, the steerable proxy functionality requires version 4.1.0.
2014-03-20 22:35:50 -07:00
Cosmo Harrigan
9683327efc
Add proxy_steerable interface for zmq_proxy_steerable in versions >= 4.0.4
2014-03-17 18:20:51 -07:00
evgeny
2658780e3a
Fixed assert on Win8.1. Thanks to jonwfreeman.
2014-03-14 13:06:11 +04:00
evgeny
1b7948c6d9
Added parameter to set the max number of sockets.
2014-03-03 19:21:18 +04:00
Jonny Dee
6c17af22b7
monitor_t: Avoid compiler warnings resulting from unused method parameters.
2013-07-18 23:52:44 +02:00
Markus Rothe
830d2ede86
Revert "Fix missing include".
...
Don't include <string> twice. Another include was introduced in 938e4ab0
.
This reverts commit f1fd8f8f6a
.
2013-07-17 13:59:06 +02:00
Andrey Sibiryov
f43e83e34e
Merge pull request #22 from ricnewton/monitor_updates
...
Move monitoring functionality out of socket_t and into monitor_t
2013-07-16 06:10:47 -07:00
Andrey Sibiryov
7975875acd
Merge pull request #23 from cjuniet/master
...
Fix missing include
2013-07-16 04:18:56 -07:00
Colin Steifel
6a04e4a7f3
Changed context_t to use new zmq_ctx_* functions
2013-07-13 14:52:51 -04:00
Colin Steifel
b9d239b0db
Adding space between function and args to conform with style
2013-07-12 17:59:42 -04:00
Colin Steifel
9751701d7a
Changed from static_cast to != to avoid warnings
2013-07-12 17:36:23 -04:00
Colin Steifel
b6839cd50d
Adding ability to check for multipart messages
2013-07-12 17:02:10 -04:00
Christophe Juniet
f1fd8f8f6a
Fix missing include
...
Add a missing include for std::string.
2013-07-04 18:46:52 +02:00
Richard Newton
32546c6538
Convert all tabs to spaces to match formatting style for rest of the file.
2013-07-01 13:33:28 +01:00
Richard Newton
666cc7ae4e
Implement monitor aborting. This relies on having the new ZMQ_EVENT_MONITOR_STOPPED event.
2013-07-01 13:31:33 +01:00
Richard Newton
37d5ecd7e2
Add event called after we have connected up our paired socket, we are guaranteed to get monitor events after this point.
...
This is useful if you are spawning the monitor to a different thread and need to wait until monitor has started before opening the socket.
2013-06-28 18:31:00 +01:00
Richard Newton
938e4ab07b
Rework monitor to support both new (3.3 and above) and old ways montior events work.
2013-06-28 17:32:49 +01:00
Richard Newton
dfea887ecb
Parse event structure as data for event handlers.
2013-06-28 14:07:27 +01:00
Richard Newton
61a21bb082
Avoid a memcpy in monitor_t
2013-06-28 12:34:18 +01:00
Richard Newton
b34444d273
Rework monitor_t.
2013-06-28 12:22:21 +01:00
Pieter Hintjens
c36e3065d2
Merge pull request #18 from Kobolog/master
...
Prevent -Wunused-value warnings from non-debug ZMQ_ASSERT macro
2013-06-27 10:55:54 -07:00
Pieter Hintjens
b009df6499
Merge pull request #17 from grefab/master
...
Allowing for unbind and disconnect
2013-06-27 10:55:43 -07:00
Pieter Hintjens
d5cf3c9410
Merge pull request #15 from montoyaedu/master
...
Added monitor_t class
2013-06-27 10:55:23 -07:00
Emmanuel Taurel
3afc98efa1
Add a disconnect method (interface to the zmq_disconnect call) in the socket_t class
2013-06-26 17:04:45 +02:00
Andrey Sibiryov
2fe20236f5
prevent unused expression result warnings from non-debug ZMQ_ASSERT macro expansion
2013-04-06 04:14:30 +04:00
Gregor Fabritius
2798087c2e
added possibility to disconnect.
2013-02-23 22:01:31 +01:00
Gregor Fabritius
de8059f190
added possibility to unbind.
2013-02-23 19:50:59 +01:00
Ian Barber
b232978003
Merge pull request #14 from robertmaynard/master
...
Define ZMQ_DELETED_FUNCTION on older clang versions.
2013-02-13 11:59:36 -08:00
H. Eduardo Montoya Sánchez
f30f92b392
syntax & bug fixing
...
modified monitor_t interface
2013-01-30 17:30:05 +01:00
H. Eduardo Montoya Sánchez
bcdf163fa8
work in progress...
2013-01-30 15:22:54 +01:00
Montoya Edu
9f7a5f18d1
Update zmq.hpp
...
corrected monitor_t::on_event_unknown prototype
corrected indentation
2013-01-29 19:14:17 +01:00
Montoya Edu
b1dacd8d0f
Update zmq.hpp
...
work in progress...
added monitor_t class
added monitor() method
2013-01-29 19:11:33 +01:00
Robert Maynard
a5174232d5
Correctly define ZMQ_DELETED_FUNCTION when using older clang compilers.
...
If you are using a version of clang that doesn't support cxx_deleted_functions
we need to define ZMQ_DELETED_FUNCTION to be empty.
2013-01-09 10:19:11 -05:00
John Swinbank
cc25ef9c52
Interface to zmq_proxy()
2013-01-05 15:50:28 +01:00
Pieter Hintjens
127c255d65
Merge pull request #10 from ricnewton/explicit-constructors
...
Make single parameter constructors explicit
2013-01-05 03:22:29 -08:00
Matt Arsenault
02ceef1727
Use deleted functions if available
2012-12-14 18:38:27 -08:00
Matt Arsenault
36722d9031
Don't use deprecated functions
2012-12-14 18:36:23 -08:00
Richard Newton
72162cecdd
Make single parameter constructors explicit
2012-11-06 18:24:39 +00:00
Pieter Hintjens
90d870b836
Merge pull request #4 from ricnewton/const_data_access
...
Add const data access to message_t
2012-08-28 21:11:02 -07:00
Pieter Hintjens
1a350206fe
Merge pull request #5 from ronelliott/master
...
Added connected helper method.
2012-08-28 21:10:50 -07:00
Richard Newton
ce3e3e2f9a
Add explicit close method to context_t
2012-08-28 13:49:14 +01:00
Ron Elliott
ad415995ee
Added 'connected' method to socket_t class.
2012-07-28 10:22:10 -07:00
Richard Newton
2efcdccace
Add const data access to message_t
...
Add a const version of data() and make size() const so we can pass messages around by
const refeference when we only need read-only data access.
2012-07-25 12:20:27 +01:00
Richard Newton
952c382575
Add move constructor to message_t
...
Add move constructor and assignment operator to message_t (but only if compiler supports it).
2012-07-25 12:06:53 +01:00
Martin Sustrik
f1640d2c9d
Revert "Renamed to XS, setctxopt method added"
...
This reverts commit 0f14f299c3
.
2012-03-16 18:11:50 +01:00
Martin Sustrik
0f14f299c3
Renamed to XS, setctxopt method added
...
Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2012-03-16 18:06:09 +01:00
Nadav Samet
0483ee0dfa
Prevent unused variable warning in presence of assertions.
2012-02-13 22:25:13 -08:00
Martin Sustrik
73fd092572
Prevent exception to be thrown in the destructor
...
The only defined error code for zmq_close() is ENOTSOCK
which indicates an error in cppzmq implementation.
It's ok to use assert here instead of throw.
Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2012-01-31 11:11:34 +09:00
Martin Sustrik
729aaad079
Change the license to MIT
...
The contributors to cppzmq project agreed on changing the license
from LGPL to MIT.
Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2011-12-13 16:03:00 +09:00
Botond Ballo
cc98ac8aba
Subject: [PATCH] C++11 move constructor/assignment operator for socket_t and context_t
...
Added a C++11 move constructor and move assignment operator to zmq::socket_t
and zmq::context_t. These functions are only enabled if the compiler supports
C++11 rvalue references. Currently the code can detect rvalue reference
support for the following compilers: GCC, MSVC, clang.
Signed-off-by: Botond Ballo <botond.ballo@gmail.com>
Copyrights and project name adjusted
Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2011-11-19 14:02:16 +01:00
Martin Sustrik
ac1ba21f13
Send and recv with plain buffer as an argument added
...
Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2011-09-14 12:21:11 +02:00
Martin Sustrik
f5bc62f8c3
Compilation errors with 3.0 fixed
...
Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2011-05-28 14:38:02 +02:00
Martin Sustrik
9da2598aa0
Update to 3.0 API
...
Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2011-05-25 18:44:58 +02:00
Martin Sustrik
38bbe08168
Initial version of C++ binding
...
Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
2011-05-25 18:42:41 +02:00