The relationship between Java and C #

I found out that there is a .Net toolkit called the GCT-Group Communication Toolkit, which is the C # version for JGroup. I want to know if these and JGroup can be connected together so that java and C # clients exchange data with each other. If not, would there be a better way to make a Java program and a C # program? Another option I came across is the implementation of XMPP. I need a very fast message transfer between these two programs that run on the same computer. The basic requirement is that any of these programs send a message to the other when certain specific events are triggered. Any ideas are welcome.

+2
java c # interop xmpp
source share
7 answers

XMPP is not what you want. It is designed to transfer messages between computers with a central server.

I would recommend using sockets to transfer data between applications. See the System.Net.Sockets.Socket class in C # and the java.net.Socket class in Java.

+4
source share

Where I work, we use ICE ( http://www.zeroc.com/ ). It allows you to create binary data between java and C #. It's not bad.

+3
source share

Response to the answer "OP" ...

The way to map the push server to the classic RPC model (for example, implemented by CORBA, SOAP, ICE, RMI, etc.) is to turn the role around so that what you consider your server fills the client role in RPC The template is as follows:

  • The client makes a call to your server by passing a handle to the callback object.

  • The server remembers the callback object and returns.

  • The client goes to bed (or does something else ...)

Later, the server wants to click some data.

  • The server calls the β€œpush” RPC for the callback object, passing data.

  • The client receives a call / request in the callback object, does something with the data and answers.

+1
source share

If I did this and needed a little delay, I could consider a memory mapped file or channel. Any of these will require JNI and p / invoke programming.

+1
source share

Google protocol buffers may be an option. It is very portable and quite fast.

+1
source share

If performance is important, see what is used in scientific computing. Scientists face the same challenges in enterprises that need to connect clients and servers, all on an even wider range of languages ​​and platforms. Perhaps this component binding tool called Babel would be useful outside its original domain? Interfaces are described by SIDL (e.g. IDL in CORBA), but I do not know if C # is enabled yet. https://computation.llnl.gov/casc/components/babel.html

0
source share

Perhaps I did not make this requirement clear. I am looking for push server technology, not client load. Therefore, I am not sure whether the above solutions will be implemented. My C # code controls the environment and handles certain events generated in that environment. When an event is fired, I record some information. This is the information I want to send to my Java code. So, as you can see, C # code should act as a server that passes data to the java client when some specific event occurs. In addition, on one computer there is only one server and one client, so there are no problems with scalability. Only concern will be about performance, because events are generated at a speed of 0.01 seconds. This is why I thought about XMPP.

0
source share

All Articles