从基于 Java 的 Eclipse 插件与独立 C 程序进行通信的最佳方式

发布于 2024-09-03 06:04:34 字数 234 浏览 4 评论 0原文

我正在编写一个 Eclipse 插件,它将在需要将“命令”发送到另一个 C 程序的模式下运行。 C 程序有一个内置的轮询器来检查事件。该插件将“推送”命令,但不需要任何响应。在两者之间建立沟通机制的最简单方法是什么?我正在考虑在 C 端使用只读 fifo,我将从轮询器中检查它,但我不确定如何协调两个进程之间的读写。当另一个进程正在访问它时,是否需要阻塞其中一个进程?如果是这样,我该如何协调?有人知道那里有样品吗?我在搜索中还没有完全找到我要找的东西。

I am writing an eclipse plug-in which will operate in a mode in which it will need to send "commands" to another C program. The C program has a built-in poller which checks for events. The plug-in will "push" commands out but doesn't need anything in response. What's the easiest way to set up a communication mechanism between these two? I was thinking about using a read-only fifo on the C side which I would check from the poller, but I'm not sure how to coordinate the reading and writing between the two processes. Does one of the processes need to block while the other is accessing it? If so, how do I coordinate this? Anyone know of any samples out there? I haven't quite turned up exactly what I am looking for in my searches.

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

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

发布评论

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

评论(1

心清如水 2024-09-10 06:04:34

最简单的可能只是通过套接字连接进行通信,这允许您使用任何网络通信库来移动实际字节。

The simplest is probably just communicating over a socket connection, which allows you to use any network communication library for moving the actual bytes.

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