Commit Graph

237 Commits

Author SHA1 Message Date
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
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
Gudmundur Adalsteinsson
324b11f239
Problem: Context lacks typesafe options
Solution: Define an enum class for the context options

Co-Authored-By: Simon Giesecke <simon.giesecke@gmail.com>

Co-authored-by: Simon Giesecke <simon.giesecke@gmail.com>
2020-02-07 15:39:58 +01:00
Simon Giesecke
b6c79eb0c8 Reformat all files with clang-format 2020-01-28 11:11:31 +01:00
Gudmundur Adalsteinsson
47969cfdcf Problem: shutdown() missing for context_t (#377)
Solution: Add shutdown(). This function is required
for clean termination of the zmq context in multi-threaded
applications where sockets are used in threads. In particular
if blocking operation are used and if sockets can be created
at any time.

* Improve tests and documentation
2020-01-27 08:31:46 +01:00
Simon Giesecke
70d059bd0a
Increase version number to 4.7.0 after release to prepare for next development iteration 2020-01-17 17:32:09 +01:00
Gudmundur Adalsteinsson
4f9c2ea519 Problem: message_t to string is hard
Solution: add to_string() function.
2020-01-07 19:54:47 +00:00
Gudmundur Adalsteinsson
d3abe06ba3 Problem: Move assigned objects still alive
Solution: Close context/socket if move assigned to
2019-12-05 20:17:43 +00:00
Gudmundur Adalsteinsson
0ef29c1b30 Problem: Detail namespace used in API
Solution: Move types into zmq namespace
2019-11-12 19:54:28 +00:00
Simon Giesecke
a34d2a3da9
Merge pull request #358 from gummif/gfa/send-recv-multipart
Problem: Handling multipart messages is complex
2019-11-08 09:41:25 +01:00
Simon Giesecke
829997d4e8
Update version number to 4.6.0 to prepare for next development iteration 2019-11-04 16:44:44 +01:00
Gudmundur Adalsteinsson
505edeb336 Problem: Handling multipart messages is complex
Solution: Add generic algorithms for sending and receiving multipart
messages.
2019-10-26 19:59:46 +00:00
Gudmundur Adalsteinsson
4bc232c175 Problem: recv return value should not be ignored
Solution: add nodiscard attribute to recv functions
2019-10-26 12:31:51 +00:00
Philip Top
d5cbaf4682 Explicitly check for optional and string_view in cases where the C++17 language is operational but the standard library in use does not have those headers.
add check for using stdlibc++ with clang or icc to make sure is_trivially_copyable is available.
2019-10-14 07:58:25 -07:00
Gudmundur Adalsteinsson
34ea5b7805 Problem: Build error with clang
Solution: Some compilers incorrectly define __GNUC__, added workaround for clang and icc.
2019-09-17 20:24:44 +00:00
Gudmundur Adalsteinsson
7d9e5cb421 Add user-defined string literals to create buffers 2019-09-11 20:38:47 +00:00
Gudmundur Adalsteinsson
ab588fb7c9 Assertion and constexpr improvements for str_buffer 2019-09-11 20:21:02 +00:00
Gudmundur Adalsteinsson
13cc1e0fe9 Problem: Sending string literals is awkward
Solution: A function str_buffer specifically for
creating buffers for null terminated string literals.
2019-09-03 14:06:19 +00:00
Simon Giesecke
3b1038d035
Merge pull request #337 from gummif/gfa/clang-warnings
Problem: Warnings about send being deprecated
2019-09-02 12:26:20 +02:00
Gudmundur Adalsteinsson
e5f1a2d045 Problem: C++14 features not detected using MSVC
Solution: Detect C++14 via C++17
2019-08-31 12:07:18 +00:00
Simon Giesecke
1f66e996d5
Merge pull request #341 from gummif/gfa/cpp11-gcc
Problem: C++11 partially supported on gcc 4.8
2019-08-31 12:41:13 +02:00
Gudmundur Adalsteinsson
4f1ff4952d Fix for lacking SFINAE support on older GCC 2019-08-30 23:14:16 +00:00
Gudmundur Adalsteinsson
6137b485a0 Problem: C++11 partially supported on gcc 4.8
Solution: Use intrinsic instead of std::is_trivially_copyable for gcc
versions older than 5.
2019-08-30 20:46:32 +00:00
Jack Olivieri
f910c90149 Fix ASCII character detection in conversion to std::string
the 'Space' ASCII character should also be recognized as such.
2019-08-30 12:39:35 +02:00
Gudmundur Adalsteinsson
85b3a945d4 Problem: Warnings about send being deprecated
Solution: Refactoring and addition deprecation of a send function taking
int flags
2019-08-14 20:42:36 +00:00
Simon Giesecke
81c2938faa
Update version to v4.5.0 to prepare for next development iteration 2019-07-24 15:16:41 +02:00
Simon Giesecke
f5b36e5635
Update version to 4.4.1 2019-07-24 15:15:09 +02:00
Simon Giesecke
86876d7307
Merge pull request #328 from xiphon/fix-recv-flags-default
Fix 'recv' function 'flags_' argument default value
2019-07-24 14:42:31 +02:00
xiphon
19b5222e4e Fix 'recv' function 'flags_' argument default value 2019-06-02 02:01:42 +00:00
Simon Giesecke
4e37816dfa
Merge pull request #325 from gummif/gfa/msg-range-ctor
Problem: message_t ctor for ranges too greedy
2019-06-01 16:23:46 +02:00