Note: This discussion is about an older version of the COMSOL Multiphysics® software. The information provided may be out of date.
Discussion Closed This discussion was created more than 6 months ago and has been closed. To start a new discussion with a link back to this one, click here.
ModelUtil.connect(solverHost, solverPort);
Posted 2012年8月23日 GMT-4 07:04 Interfacing, Parameters, Variables, & Functions Version 4.3 1 Reply
Please login with a confirmed email address before reporting spam
I try to compair the results of two solvers running in parallel on two different comsol-servers.
Therefor I try to establish a link from my Java-API to two comsol server. But only one connection will be established. Can someone give me a hint to find a workaround?
Any help is warmly welcome!
Thanks
Matthias
My Java-code :
public class StartPoint {
public static void main(String[] args) {
Thread a = new Thread(new MultiTest("localhost",2036));
Thread b = new Thread(new MultiTest("localhost",2040));
a. start();
b. start();
}
}
class MultiTest implements Runnable
{
private String solverHost;
private int solverPort;
public MultiTest(String solverHost,int solverPort){
this.solverHost=solverHost;
this.solverPort=solverPort;
}
public void run(){
System.out.println("try: "+solverPort);
ModelUtil.connect(solverHost, solverPort);
System.out.println("done: "+solverPort);
}
}
The output:
try: 2036
try: 2040
done: 2036
Hello Matthias Juettner
Your Discussion has gone 30 days without a reply. If you still need help with COMSOL and have an on-subscription license, please visit our Support Center for help.
If you do not hold an on-subscription license, you may find an answer in another Discussion or in the Knowledge Base.