Most of the IPC mechanisms provided by POSIX operating systems are quite basic. Their APIs are built using file descriptors and they treat input and output channels as raw sequences of bytes.
Applications, however, tend to use data fragments of specific lengths and purposes for data interchange messages. Despite API mechanisms of operating systems being flexible and generic, they are not always convenient for message exchange. That is why dedicated libraries and components were built on top of default IPC mechanisms to simplify the message exchange mode.
In this recipe, we will learn how to implement an asynchronous data exchange between two applications using the publisher-subscriber (pub-sub) model.
The model is easy to understand and widely used for the development of software systems designed as collections...