Java和C / C ++程序的命名管道 [英] Named pipes between Java and C/C++ programs
问题描述
我觉得在Windows中使用命名管道用Java编写的C.通常我使用套接字连接来做到这一点两个应用程序之间进行通信的,但现在我不得不取消这个想法,并找到一个新的解决方案。
I think of using in windows a named pipe to communicate between two apps written in Java and C. Normally i use socket connection to do this, but now i have to cancel this idea and find a new solution.
我读了在Java命名管道可以看到里面只有JVM,这是真的吗?
有没有建立命名管道的方式两个应用程序之间的不同的语言wriiten?
I read that named pipe in java can be visible only inside JVM-is this true? Is there a way to establish named pipe between two apps wriiten in different language?
如果没有,请你指点什么样的技术?
If not, what kind of technology do You advice?
推荐答案
在为了的创建的Java中的一个Windows命名管道,你不得不求助于使用JNI调用本地WINAPI功能
In order to create a Windows named pipe in Java, you'd have to resort to using JNI to call the native WINAPI functions.
您可以创建在C命名管道++,不过,并在创建后的管道空间打开它作为一个文件使用它在Java中。
You can create the named pipe in C++, though, and consume it in Java by opening it as a file in the pipe namespace after it has been created.
这篇关于Java和C / C ++程序的命名管道的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!