Qt portable IPC: only QSharedMemory?

I am looking for suggestions for choosing a portable way to achieve local IPC in a reliable way, since I am new to C ++ and would like to avoid common mistakes when playing with shared memory and locks; so i was thinking about ipc messaging style.

In any case, I planned to use qt for other reasons, so I looked into Qt ipc.

If I understand correctly, qt does not offer fully portable ipc messaging. he can use d-bus, but using it on windows would be a problem. other ways are limited to embedded Linux platforms (and I would like to pass this thing on AIX).

I could not find a “signal and slot” or messaging style implementation that uses QSharedMemory and QSystemSemaphores

Thus: am I limited to implement the QSM / QSS function? What other options could I explore? posix pipe? protocol buffers? speed up queues and messages?

I'm going to release code under the LGPL / GPL style license, does this exclude protocol buffers or boost libs?

please, again, the interface should be simple and newbie (otherwise I will definitely delay things for a long time :)), and therefore type serialization / deserialization, error handling and resource utilization should follow.

+4
source share
3 answers

Take a look at Boost.Interprocess , which provides many IPC features. I used interprocess message_queue , which provides a pretty clean and easy way to do what I think you want to do.

+4
source

You can use QLocalSocket and QlocalServer for IPC too. These two classes are very easy to use and can be implemented in much the same way as using the Qt TCP socket client / server.

You can watch some of these youtube videos:

QTCPServer - The basic TCP server application

QTcpServer using multiple threads

(Almost the sames principles will apply for a "local" server / client instead of "TCP")

+2
source

Like Qt 5.9, there is a module that is currently called QtRemoteObjects technology preview , which provides Qt's native IPC for QObjects, is easy to use, and can be used to share signals / slots, as well as models between two processes.

It works well for Linux, Windows and Android.

0
source

All Articles