Skip to content

Latest commit

 

History

History
39 lines (25 loc) · 900 Bytes

README.md

File metadata and controls

39 lines (25 loc) · 900 Bytes

ZMQ Pub-Sub

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.

ZMQ C++.

Bootstrap

Bootstrap script to install ZeroMQ is included for Ubuntu 18.

Building the Program

Cmake has been included so you can build the project simply:

❯ rm -rf build && mkdir build
❯ cd build
❯ cmake ..
❯ make

Running the Program

After 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 ./subscribe

Then, in another terminal window run the publish program:

❯ sudo ./publish