Commit Graph

265 Commits

Author SHA1 Message Date
Stefan Dietel
224bfca5b7 moved process_event into protected area 2023-08-25 14:18:58 +02:00
Stefan Dietel
f2301a8769 split check_event
made monitor_socket protected
2023-08-25 14:18:32 +02:00
Stephan Schim
b5ce0ada48 active_poller and poller_t support for file descriptors 2023-07-19 16:09:27 +02:00
Gudmundur Adalsteinsson
b1bd1410cd
Version 4.10.0 2023-06-20 10:00:01 +00:00
Uy Ha
36b6053f92 call the correct function 2023-06-07 14:51:03 +00:00
Uy Ha
f51fa9695a add function for adding file descriptor to poller_t 2023-06-07 14:27:26 +00:00
Michael Schubert
21320c8f45 add DRAFT socket options for libzmq 4.3.2-4 2023-05-30 00:12:13 +02:00
Teebonne
9fa9fbfddf
Rebuild with string argument, like the constructor
More convenient
2022-10-10 20:08:02 +01:00
Gudmundur Adalsteinsson
21607318f6 Version 4.9.0 2022-10-09 14:20:05 +00:00
Andrij Abyzov
cfb0073717
Add support for ZMQ_ONLY_FIRST_SUBSCRIBE option 2022-06-08 16:04:42 +02:00
Gudmundur Adalsteinsson
26362337a9
Merge pull request #553 from gin-ahirsch/gcc-non14-constexpr
Suppress ZMQ_EXTENDED_CONSTEXPR on gcc with partial C++14 support
2022-05-10 13:05:26 +00:00
Alexander Hirsch
b9f6e06a16 Suppress ZMQ_EXTENDED_CONSTEXPR on gcc with partial C++14 support 2022-05-06 09:09:12 +02:00
Jaakko Moisio
cbe449908e Problem: sock.get(zmq::sockopt::type) is not typesafe
Solution: Add `zmq::sockopt::socket_type` that is used to `get()` an enumerator
from `zmq::socket_type` instead of plain `int`.

It makes code like this compile:

  #include <zmq.hpp>

  #include <cassert>

  int main()
  {
      zmq::context_t ctx;
      zmq::socket_t sock(ctx, zmq::socket_type::push);
      assert(sock.get(zmq::sockopt::socket_type) == zmq::socket_type::push);
      return 0;
  }
2021-10-21 20:53:40 +03:00
Gudmundur Adalsteinsson
37d70cca7f Bump version 2021-09-19 08:52:02 +00:00
Ashish Jindal
6f8a1805a5
ZMQ_DEPRECATED doesn't fallback for unrecognized compiler
If you use a compiler outside of _MSC_VER and _GNUC__, then the if-else check doesn't provide a fallback for ZMQ_DEPRECATED macro which leads to a build failure.
Specifically in my case , I am using Oracle's SunPro 5.13.0.

My suggestions is to fallback to noop in case you don't recognize a compiler.
2021-09-16 13:36:41 -04:00
Luca Boccassi
180fbcc561
Merge pull request #497 from zeromq/gfa/pollms
Problem: poll default timeout is deprecated
2021-08-13 15:10:19 +01:00
Gudmundur Adalsteinsson
2b466a6e40 Call non-deprecated functions in implementation 2021-07-25 18:42:44 +00:00
Hiroki Takeuchi
e8d0f4a4e8 Fix handshake event don't need DRAFT API in libzmq v4.3.0 and above 2021-07-19 08:49:17 +00:00
Gudmundur Adalsteinsson
7aa3f37a5c Problem: poll default timeout is deprecated
Solution: default to std::chrono::milliseconds
2021-07-14 22:45:27 +00:00
Joshua Luckel
6ad0aceac5 context_t close no longer uses deprecated function 2021-05-13 10:27:09 +10:00
Dominic van Berkel
24837086cc Add all DRAFT socket types up to libzmq 4.3.4 2021-04-17 15:53:28 +02:00
Simon Giesecke
dc4c0656a6
Merge pull request #482 from kevle/monitor-check_event-raii
Fix for potential memory leak in monitor_t::check_event
2021-03-10 22:21:42 +01:00
albestro
1a4ebda46e
genealize arithmetic operators for socket_base and derived (#470)
Generalize arithmetic operators for socket_base and derived
2021-03-10 22:20:33 +01:00
Kevin Leonardic
8d36a7c510 Problem: zmq_msg_t not closed on exception
Solution: Use zmq::message_t
2021-03-06 14:11:53 +01:00
Gudmundur Adalsteinsson
f428fee374
Problem: zmq_fd_t not used/available in zmq (#452)
* Problem: zmq_fd_t not used/available in zmq

Solution: Make zmq::fd_t available and use in poller_event

* Deprecate typedef with comment
2021-02-12 12:28:40 +01:00
Gudmundur Adalsteinsson
a7889af4bf Problem: if constexpr warnings on MSVC
Solution: Use if constexpr where possible in C++17
2020-11-26 20:55:04 +00:00
Simon Giesecke
18db4568f9
Merge pull request #451 from gummif/gfa/poller-size
Problem: Poller size function missing
2020-11-25 10:00:04 +01:00
Gudmundur Adalsteinsson
d57ffc5cf7 Problem: connected() is confusing
Solution: Deprecated it, it is not related to connect/disconnect.
2020-10-24 18:00:52 +00:00
Gudmundur Adalsteinsson
2af0c0105a Problem: Poller size function missing
Solution: Add it to poller_t
2020-10-10 21:22:16 +00:00
Sylvain Corlay
c34d8eaaec Fix VS2015 syntax error with ZMQ_DEPRECATED macro. 2020-10-05 12:26:28 +02:00
Simon Giesecke
07ac9fef63
Bump version number to 4.8.0 after release to prepare for next development iteration 2020-09-30 12:24:28 +02:00
Simon Giesecke
fef905d598
Merge pull request #399 from gummif/gfa/message-ctor
Problem: message_t ctor string inconsistency
2020-09-08 11:42:55 +02:00
Gudmundur Adalsteinsson
e9716fa6e6
Problem: C++ version not correctly estimated (#429)
* Problem: C++ version not correctly estimated

Solution: Include headers before checking macros and add additional checks for _MSVC_LANG.
2020-09-08 11:38:06 +02:00
Gudmundur Adalsteinsson
ae570b0835 Apply clang-format 2020-09-07 21:37:44 +00:00
Gudmundur Adalsteinsson
1897488a28 Problem: message_t ctor string inconsistency
Solution: Constuctor taking generic ranges including
string literals includes the null terminated char in
the message. Deprecate function and add overloads
for strings.
2020-09-07 21:37:01 +00:00
Simon Giesecke
bf4f75b971
Merge pull request #405 from gummif/gfa/active-poller-handler
Problem: Active poller double add mutates handler
2020-09-07 10:01:26 +02:00
Gudmundur Adalsteinsson
3e3fe85b33 Add ctor to error_t taking errno and add noexcept specifiers 2020-09-06 13:25:11 +00:00
or17191
37e6334d5f Bugfix: socket_t move assignment doesn't initialize ctxptr
Until now, we only assigned the _handle on
`zmq::socket_t::operator=(socket_t&&)`. This manifests when trying to
monitor a socket initialized by that constructor.

To avoid changing the public interface of the socket_t class, we tested
for the specific monitor usecase, since it's the only class accessing
zmq::socke_t::ctxptr.

NOTE: When running the new unit-test without the fix, it might hang on
`zmq_socket_monitor(socket_, NULL, 0)`. We haven't figured out the cause
for that, but we deemed it unimportant (or at least out of scope).
2020-07-18 19:17:19 +03:00
Simon Giesecke
89f4d1b187
Merge pull request #408 from gummif/gfa/ctx-handle
Problem: implicit conversion operators in context
2020-06-19 18:10:38 +02:00
Gudmundur Adalsteinsson
1fc3a9a873 Document macro usage and simplify code 2020-05-24 21:34:42 +00:00
Gudmundur Adalsteinsson
6d71b9b541 Replace checks for C++17 with string view macro 2020-05-16 12:39:54 +00:00
Gudmundur Adalsteinsson
5a3dee082e Problem: implicit conversion operators in context
Solution: add handle() and mark operators as deprecated
2020-05-15 20:38:05 +00:00
Critical2104
b0e72439bd Deprecate poll overload accepting a long timeout value 2020-05-15 12:58:51 +02:00
Critical2104
8d35b8c934 Added poll() overload accepting std::array 2020-05-15 12:50:22 +02:00
Simon Giesecke
9b824dd36f
Merge pull request #407 from jcfr/fix-macos-10.11.6-default-init-error
Fix error: default initialization of an object of const type
2020-05-14 12:32:05 +02:00
Jean-Christophe Fillion-Robin
5e2862320d
Fix error: default initialization of an object of const type
This commit fixes a regression introduced in a3e5b54c3 (Problem: Socket
options lack type-safety (#393)).

It addresses the following error reported when building the project
on macOS 10.11.6.

Errors like the following:

  cppzmq/zmq.hpp:1325:39: error: default initialization of an object of const type 'const affinity_t' (aka 'const integral_option<4, unsigned long long, false>') without a user-provided default constructor

Compiler version:

  Apple LLVM version 8.0.0 (clang-800.0.42.1)
  Target: x86_64-apple-darwin15.6.0
  Thread model: posix
  InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin

Similar issues:

 * https://github.com/tensorflow/tensorflow/issues/28839
  error: default initialization of an object of const type 'const Subgraph::Identity' without a user-provided default constructor

 * https://bugzilla.mozilla.org/show_bug.cgi?id=1451088
   Clang 3.8: error: default initialization of an object of const type 'const js::jit::ArithPolicy' without a user-provided default constructor

 * https://github.com/googleapis/google-cloud-cpp/issues/1593
   [osx] error: default initialization of an object of const type

Co-authored-by: Gudmundur Adalsteinsson <ofpgummi@yahoo.com>
2020-05-05 17:54:34 -04:00
Gudmundur Adalsteinsson
1793a5b586 Problem: UB in message_t constructor
Solution: Add check to guard against passing null to memcpy
2020-04-05 20:25:00 +00:00
Gudmundur Adalsteinsson
a3e5b54c3c
Problem: Socket options lack type-safety (#393)
Solution: Implement a type for each socket option.

Each option has an associated type, therefore they
can't be simply defined as an enum class.

Use new sockopt getter in test util

Add socket option get function for strings and tests
2020-03-24 09:33:50 +01:00
Brett Viren
10431084bb
Problem: lack conversion message_t and multipart_t (#391)
Solution: add encode/decode methods to multipart_t giving a codec compatible with the CZMQ equivalent.
2020-03-20 10:59:15 +01:00
Gudmundur Adalsteinsson
5999e5adc7
Problem: Macros not defined in older versions (#386)
* Problem: Macros not defined in older versions

Solution: Guard usage of libzmq macros

* Test older version of libzmq with C++11 or later

* Use a slightly newer libzmq version
2020-02-21 11:29:12 +01:00