Johan
Johan

Reputation: 20773

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 techniques 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

Upvotes: 1

Views: 1509

Answers (3)

Ignacio Vazquez-Abrams
Ignacio Vazquez-Abrams

Reputation: 799150

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.

Upvotes: 1

Edgar Bonet
Edgar Bonet

Reputation: 3566

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.

Upvotes: 5

Vinko Vrsalovic
Vinko Vrsalovic

Reputation: 340316

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.

Upvotes: 4

Related Questions