在 ac 程序和 C++ 之间使用什么 Linux IPC? Qt 应用程序?

发布于 2024-09-25 19:45:52 字数 236 浏览 0 评论 0原文

我有一个老式的 c 程序,时不时地 需要告诉基于 C++ Qt 的应用程序有关我的系统上发生的一些“事件”。

但是当我开始解决这个问题时,我注意到一些 ipc 技术在 C 程序中非常容易使用。 然后我们有一些在“Qt 世界”中运行良好的 Qt 特定样式, 但它们在 ANSI C 程序中不能很好地工作。

对于在 Qt C++ 和 ac 程序中运行良好且易于使用的 ipc 技术,您有什么建议吗?

谢谢 约翰

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

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

逆光飞翔i 2024-10-02 19:45:52

如果您熟悉网络编程,Unix 域套接字也应该很容易。它们的工作方式有点像双向命名管道,Qt 中的网络 API 应该可以轻松接收作为网络消息传递的“事件”。

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.

小猫一只 2024-10-02 19:45:52

命名管道怎么样?您可以像操作常规文件一样对它们进行操作(当然创建方式有点不同),我敢打赌旧的 ANSI C 程序和新的 Qt C++ 程序都可以对文件进行操作。

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.

余生一个溪 2024-10-02 19:45:52

如果事件通知非常简单,那么您可以使用信号

如果外部来源的通知有用,则可以选择 D-Bus

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文