Message Boards Message Boards

0
|
2133 Views
|
0 Replies
|
0 Total Likes
View groups...
Share
Share this post:

Can Listen Mode Connnections do what I need?

Posted 9 years ago

I need some help understanding the documentation on Listen Mode connections. I cant tell if if what I want to do is even possible.

My idea is to have a Java program or separate thread that snoops on other Java programs that are connected to Mathematica. For instance, the Snooper could display the values of all variables in the other program after each step in a computation.

Both programs would run on a PC against a local copy of Mathematica.

Question 1: Is this doable?

Question 2: Will something like this work to create the connection? Is anything else necessary before the Snooper can make requests to the other program's Mathematica session?

On the Snoopee:   String[] listenLinkArgs = {"-linkmode", "listen", "-linkname", "myLink"}; 
                  listenLink = MathLinkFactory.createKernelLink(listenLinkArgs); 

On the Snooper:   String[] connectLinkArgs = {"-linkmode", "connect", "-linkname", "myLink"}; 
                  connectLink = MathLinkFactory.createKernelLink(connectLinkArgs); 

Question 3: Can the user continue using their program interactively while the Snooper monitors their Mathematica session and does queries against it?

Question 4: Some places describe the connection process the MathLinkFactory.createKernelLink way and others are going on about TCPIP and rsh and LinkOpen["myLink", LinkMode->Connect], etc. What is the relationship between all that stuff and MathLinkFactory.createKernelLink?

A simple HelloWorld type example showing how to do this stuff would do more good that all the abstract documentation.

POSTED BY: James Strunk
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract