什么是Java和.NET 3.5之间的进程间通信的最佳方法? [英] What is the best method of inter-process communication between Java and .NET 3.5?

查看:107
本文介绍了什么是Java和.NET 3.5之间的进程间通信的最佳方法?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

一个第三方应用程序读取XML文件中一些Java code,并运行它,当某个事件发生。在Java中,我想讲一个.NET 3.5的应用程序,在同一台机器上运行,该事件发生。每次传输的总数据大概是几个字符。

A third-party application reads some Java code from an XML file, and runs it when a certain event happens. In Java, I want to tell a .NET 3.5 application, running on the same machine, that this event occurred. The total data transferred each time is probably a few characters.

什么是使用Java来告诉大家,事情发生了.NET程序的最佳方法是什么?

What is the best way of using Java to tell the .NET process that something happened?

Java的似乎不支持Windows命名管道,.NET本身不支持内存映射,以及涉及Web服务或任何解决方案RMI是矫枉过正。

Java doesn't seem to support Named Pipes on Windows, .NET doesn't natively support memory-mapping, and any solution involving web services or RMI is overkill.

推荐答案

如果你不想RMI的全部开销,你可以做两者之间的直接套接字通信电子通过打开的端口和交谈海誓山盟。你必须有一定的方式有两种工艺同意其端口的使用,如何握手/等,但会比RMI更简单。

If you don't want the full overhead of RMI, you could do direct socket communcation between the two by opening ports and talking to eachother. You'd have to have some way to have both processes agree on which ports to use, how to handshake/etc, but would be simpler than RMI.

ETA:它看起来像你可以的使用的命名管道从Java,你就不能的创建的呢?因此,如果.NET过程将创建它,你可以读/写它与Java。 Java的只是把它看作一个文件?

ETA: it looks like you can use named pipes from java, you just can't create them? So if the .NET process would create it, you could read/write to it with java. Java just sees it as a file?

这篇关于什么是Java和.NET 3.5之间的进程间通信的最佳方法?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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