Java和C应用程序之间的IPC [英] IPC between Java and C applications

查看:114
本文介绍了Java和C应用程序之间的IPC的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有2个应用程序,一个用C语言编写,另一个用Java编写,它们假设在同一台机器上运行。在它们之间实现IPC的最佳方法是什么?

I have 2 applications, one written in C and the other in Java, that suppose to run on the same machine. What is the best way to implement an IPC between them?

最佳意义的可移植性,最小的用户意识(防火墙弹出窗口......)等。

best meaning portability, minimal user awareness (firewall popups...), etc.

推荐答案

我会使用Sockets over loop to start。这允许您发送文本或二进制数据,并在一个进程启动或死亡时干净地处理。延迟大约为20-50微秒,具体取决于您对数据的处理以及发送的数量。

I would use Sockets over loop back to start with. This allows you to send text or binary data and cleanly handle when one process starts or dies. The latency is about 20-50 micro-seconds depending on what you are doing with the data and how much you send.

套接字独立于平台,可以在纯Java中使用。有数以百万计的Java示例和教程。

Sockets are platform independent and can be use in pure Java. There are millions of examples and tutorials available for Java.

这篇关于Java和C应用程序之间的IPC的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆