Skip to content

Commit 1697a5e

Browse files
authored
Merge pull request #477 from avinxshKD/docs/zmq-readme
docs: add ZMQ transport section to README
2 parents b6cfcaa + a84ae7b commit 1697a5e

1 file changed

Lines changed: 25 additions & 0 deletions

File tree

README.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,31 @@ Do **NOT** commit your secret key to version control. If `FLASK_SECRET_KEY` is n
115115

116116
For a detailed and more scientific documentation, please read our extensive [open-access research paper on CONTROL-CORE](https://doi.org/10.1109/ACCESS.2022.3161471). This paper has a complete discussion on the CONTROL-CORE architecture and deployment, together with the commands to execute the studies in different programming languages and programming environments (Ubuntu, Windows, MacOS, Docker, and distributed execution).
117117

118+
## C++ ZMQ Transport
119+
120+
`concore.hpp` supports ZMQ-based communication as an opt-in transport alongside the default file-based I/O.
121+
122+
To enable it, compile with `-DCONCORE_USE_ZMQ` and link against cppzmq:
123+
124+
```bash
125+
g++ -DCONCORE_USE_ZMQ my_node.cpp -lzmq -o my_node
126+
```
127+
128+
In your C++ node, register a ZMQ port before reading or writing:
129+
130+
```cpp
131+
#include "concore.hpp"
132+
133+
Concore c;
134+
c.init_zmq_port("in1", "bind", "tcp://*:5555", "REP");
135+
c.init_zmq_port("out1", "connect", "tcp://localhost:5556", "REQ");
136+
137+
vector<double> val = c.read("in1", "", "0.0");
138+
c.write("out1", "", val, 0);
139+
```
140+
141+
Builds without `-DCONCORE_USE_ZMQ` are unaffected.
142+
118143

119144
# The _concore_ Repository
120145

0 commit comments

Comments
 (0)