Java application intercomunicates with C++ application
Originally, I have two application written in C++ (MFC) that comunicates
between each others using IP (interprocessing communication) concept.
I use "shared memory" concept that is known as mapped file in Visual c++.
I did not use COM for some unconvenient reasons.
My question is, is it possible to have Java application intercomunicates
with C++ application using this IP concept? I am wondering if Java supports
"shared memory" concept?
Appreciate any helps.
Re: Java application intercomunicates with C++ application
>My question is, is it possible to have Java application intercomunicates
>with C++ application using this IP concept?
Yes and No.
Using java only you can not.
However you can develop a shared library(probably DLLs in windows lingo )
written in C/C++ to provide access to your shared memory segment(s) via
well defined APIs and then write a thin java wrapper to access your library
using Java native interface(JNI). So your java program does just provides
a set of methods to access shared memory and on each method invocation it
gets delegated to the native library. You can get the JNI spec from http://java.sun.com/products/jdk/1.1...ad-pdf-ps.html
and a tutorial on how to use JNI from the java tutorial from SUN : http://web2.java.sun.com/docs/books/...1.1/index.html
I remember reading an article on developing an IPC mechanism for java (similar
approach as above but with more details) on www.java-pro.com about one and
half years back. Unfortunately I do not have the url.
>I am wondering if Java supports
>"shared memory" concept?
Java does not support shared memory concepts. You can make two applications
residing in two different JVMs communicate with each other by using sockets
or RMI or JMS or CORBA.
Hope this helps.
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL