IPC between Qt and C / C ++

I need to send / receive data between two processes. One of them will use Qt (4 or 5). This process will work all the time (for example, a background process).

Another process will be started, and then it will be able to send argv to the first process and receive a answer from it.

The second process should start as quickly as possible, so using QtCore is the last resort. Meaning, I need it to be as small and fast as possible, so I would need to use simple C / C ++ without any external libraries.

Any ideas on how to do this?

If this is not possible, I will have to use QtCore in the second process. Do you know how much slower would be due to QtCore vs plain C / C ++? (in terms of launch time).

Hello

EDIT:

I can not use QBus, as it must be compatible with Mac / Linux / Windows.

+4
source share
1 answer

If this is necessary for full cross-platform compatibility, your best option is likely to be called sockets / named pipes, which should work on each platform. It should take you to the information you need to configure the socket. You still need the network processing code in your clean C ++ application, but it should be significantly less overhead than Qt-Core and Qt-Network.

You can also do this with shared memory, but I prefer the socket method for simplicity.

+4
source

All Articles