This is a simple project that shows how to use ZeroMQ's Pub-Sub to communicate between two programs. The publish.cpp file opens and binds to the pub port and sends out 100 messages. The subscribe.cpp file subscribes to the port and prints out messages that it receives.
Bootstrap script to install ZeroMQ is included for Ubuntu 18.
Cmake has been included so you can build the project simply:
❯ rm -rf build && mkdir build
❯ cd build
❯ cmake ..
❯ makeAfter building the program, it will create the publish and subscribe binaries in the build directory.
Firstly, in one terminal window run the subscribe program:
❯ sudo ./subscribeThen, in another terminal window run the publish program:
❯ sudo ./publish