Repository navigation
Conversation
concore_base.hpp included <zmq.hpp> inside namespace concore_base, so every standard header it pulls in got wrapped in that namespace too. Building any C++ node with -DCONCORE_USE_ZMQ failed with ~700 errors, for both concore.hpp and concoredocker.hpp. Moved the include above the namespace, still behind CONCORE_USE_ZMQ. Added TestConcoreZmq.cpp, which sends a request and a reply between two Concore objects over a local socket and checks values and simtime. Build it with -DTEST_DOCKER_HEADER to run it against concoredocker.hpp.
Same problem Java (ControlCore-Project#577) and Python (ControlCore-Project#599) had: once a REQ socket misses a reply, every later send fails with "Operation cannot be accomplished in current state", so the node can never write on that port again. Set ZMQ_REQ_RELAXED and ZMQ_REQ_CORRELATE on REQ sockets, like the other two runtimes. Also moved the existing options to set(zmq::sockopt::...) since setsockopt() is deprecated in cppzmq and warns with -Wall. The new test is the C++ version of the Python one: the first reply never comes, the second request still goes out and the late reply is dropped.
The matrix marked both C++ write_zmq rows as passing from reading the code, since there was no ZMQ test. Added both fixture cases to TestConcoreZmq.cpp: a list write sends [simtime+delta, ...] and leaves simtime alone, and a string write is sent as is. Updated the two notes to point to the test.
Nothing built C++ with -DCONCORE_USE_ZMQ before, which is how the namespace include went unnoticed. Installs cppzmq on each runner and runs TestConcoreZmq.cpp. The Linux job also runs it against concoredocker.hpp.
zmq::sockopt, used for the socket options now, came in cppzmq 4.7.
Contributor
Author
|
Hi @pradeeban! The C++ checks are red only because of the tryparam tests that are failing on dev too, #629 fixes those. I'll rebase once that's merged so the new ZMQ tests run here as well. Thanks! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #632
The C++ ZMQ transport didn't compile because
concore_base.hppincluded<zmq.hpp>insidenamespace concore_base. I moved the include above the namespace, still behindCONCORE_USE_ZMQ.Once it built, the new test showed the REQ socket had the same problem Java (#577) and Python (#599) had, so C++ REQ ports now set
ZMQ_REQ_RELAXEDandZMQ_REQ_CORRELATEtoo.Commits:
TestConcoreZmq.cppwith a request/reply round trip between twoConcoreobjectswrite_zmqcases from the conformance fixtures. The C++ notes in the matrix now point to this test, they said it was only checked by reading the codeconcoredocker.hppI also switched the existing
setsockopt()calls toset(zmq::sockopt::...)becausesetsockopt()is deprecated in cppzmq. That needs cppzmq 4.7 or newer.The C++ jobs on dev currently fail on the two
tryparamcomma tests inTestConcoreHpp.cpp, #629 fixes that. With that one line applied, all three C++ jobs pass in my fork.Before (dev)
After