I am looking for some existing way of broadcasting data localy (like IPC, but in in an unconnected way).

The need: I am currently having a computation program that has no HMI (and won't have) and I would like this program to send information about its progress so another one can display it (for example in an HMI). But if there is no other program "listening", the comptation is not interrupted. And I would like to have the minimum logic embeded in the computation program.

I have found things about IPC, but it seems to work only in a client-server configruation. So I have identified that my need is to find a way of broadcasting the data, and clients may or may not listen to this broadcast.

How can i do this ?

EDIT: I would like or a very light solution (like a standalone set for .h files (not more than 5)) or even a way of doing it by myself : as I said, IPC seems ok but it is working in a connected way. For example, the 0MQ (http://zguide.zeromq.org/page:all#Getting-the-Message-Out) is doing exactly what I need, but is embeding to much functionalities.

有帮助吗?

解决方案 2

For now, the Shared memory (on UNIX) seems to do the job. It remains several points I have not investigated yet:

  • compatibility between OS (it's C++ and I would like it to be build-able under any platform without having to change the code)
  • Sharing complex objects with undetermined size at compilation time.
  • Dynamic size => might be really complicated to have something efficient.

So I am still open and waiting for a better solution.

其他提示

You can try with MPI library this purpose.

Have a look at this

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top