ZMQ is a multiplatform high level socket library (sockets with steroids), that implements many paradigms as multicast, broadcast, client-server, etc. in a new and brilliant way. It is very actively developed, with a great community and used in many real projects. Are you thinking in building your own distributed application? Don’t think more, use ZMQ.
You can read a post about this example and the ZMQ project in our blog.
This example uses the C++ binding, published in this block which in turn depends on the main libzmq block explained above.
Of course it is possible to just copy the source code files as explained in the blog post, if you want to check that running them is as simple as copying the code inside a biicode project.
But as this example is already in biicode, it is very simple to build it, by just opening the block.
$ bii init clientserver $ cd clientserver $ bii open examples/zmq_cpp
If in windows, it is necessary to specify VS (it doesnt work with MinGW), otherwise, you can skip this step.
$ bii configure -G “Visual Studio 12”
Then build and run, first the server, then the client (you need to open another console, in the same folder).
$ bii build $ bin/examples_zmq_cpp_hwserver // another console $ bin/examples_zmq_cpp_hwclient
You should see how the client send “Hello”s to the server and the server respond back “World”.