Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to start Mat-Eng on a remote pc

 
kimi lynn
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello everybody,
Please bear with me if my question sounds really basic, I'm absolutely new to java Ok, here it goes what i'm trying to do.....
I wanting to start the matengine(Matlab) on another machine which is in the same network.Ip-adress and port no would be the inputs in-order to get connected to that machine.I'm able to start matlab(matengine) on my local pc by pressing a button.It works nice.ll'y, i would like to do on the remote pc too.I've some idea about sockets and have written a test program like, server and client.I keep running the server program on one machine and from the client I send a mesg to the server and its echoed back to the cient.
If some body has done such examples, pls gimmi the references or any other suggestions how i can start up with.All i want to do is to start the mateng on the remote pc.
Thanks for all your time
 
Ernest Friedman-Hill
author and iconoclast
Marshal
Pie
Posts: 24212
35
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Kimi,
Well, if you've written a socket echo program, then in theory, you can execute your program in the server code in exactly the sameplace where you currently send the echo. You've got all the pieces, and could just put them together. Sun's Java tutorial has a section on sockets that should be useful.
It might be simpler, on the other hand, to write this as an RMI program. Java RMI, or Remote Method Invocation, is a nice system for writing distributed Java programs; see here for more info.
 
kimi lynn
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello everybody,
Here how I've come up again w.r.t my first post.This program can start matlab on a server(localhost) where the ip-address and port no's are the inputs.As of now,the inputs are hard-coded in the code.When the IP-address matched with that of my local machine, then this works fine.I'm kinda confused in order to modify this code to make it working on a different machine.I've read that there should be server and client programs separately ,i.e server and client and the server program has to start first in-order to wait for the client to communicate.Am i right?? Could somebody pls help me.
Thanks for your time.
Heres the code under the action event

and the class file looks like:
 
Stan James
(instanceof Sidekick)
Ranch Hand
Posts: 8791
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Just with a quick eye-ball your server program looks like a good start. Give it a main method put the class on your server machine and start it up. Then your client will be able to connect to it.
As you test, you may (or may not) find problems with how you're handling output from the command. I did this once (see Unfinished Example) and made two threads to read stdout and errout. Turned out to be a challenge to tell when both were truly done!
 
kimi lynn
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for the links.yeah,making a main method in the server class did the trick
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic