What Linux IPC to use between a c program and a C++ Qt app?
I have a old school c program that now and then need to tell a C++ Qt based application about some "events" that has occurred on my system.
But when I started to work with this problem I noticed that some ipc techn开发者_Python百科iques is quite easy to use in the c program. And then we have some Qt specific styles that works quite well in the "Qt world", but they will not work well in the ansi c program.
Do you have any advice on ipc techniques that works well and are easy to use in both a Qt C++ and a c program?
Thanks Johan
If you are familiar with network programming, Unix domain sockets should be easy also. They work kind of like bidirectional named pipes and the network API in Qt should make it easy to receive "events" delivered as network messages.
What about named pipes? You can operate on them just like on regular files (creation is a bit different of course), and I bet both old ANSI C programs and new Qt C++ programs can operate on files.
If the event notifications are very simple then you could use signals.
If the notification is useful from/to outside sources then D-Bus is an option.
精彩评论