Hi Doru,

Am 27.03.2014 um 13:07 schrieb Tudor Girba:
> Just a question: is there a way to communicate with an already running VM 
> that was started independently from Pharo?

JNIPort uses the Java VM as a DLL / shared library, using the Java Invocation 
Interface which is part of the Java Native Interface. Actually, the Java VM 
*is* a shared library, and the java.exe is just a wrapper for starting it. When 
using JNIPort, the Pharo VM and the Java VM run in the same operating system 
process, and communicating with the Java VM just means calling functions from a 
library.

Communicating with an already running Java VM is a totally different use case, 
as the Pharo VM and the Java VM run in two different operating system 
processes. To establish a communication between them, you would have to use an 
inter-process communication mechanism available in both of them. Pipes, TCP 
sockets, a messaging system, or running one of them as a server and the other 
as a client using a common protocol. That’s not what JNIPort is made for, and 
what you need for implementing it depends on the communication mechanism.

HTH,
Joachim


Reply via email to