Quantcast
Channel: Latest Discussions - COMSOL Forums
Viewing all articles
Browse latest Browse all 26527

ModelUtil.connect(solverHost, solverPort);

$
0
0
Hi everyone,
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

Viewing all articles
Browse latest Browse all 26527

Trending Articles