|
|
@ -1,9 +1,28 @@ |
|
|
|
package verteiltesysteme.mandelbrot.rmi; |
|
|
|
|
|
|
|
import java.io.IOException; |
|
|
|
import java.net.InetAddress; |
|
|
|
import java.net.ServerSocket; |
|
|
|
import java.net.Socket; |
|
|
|
import java.rmi.registry.LocateRegistry; |
|
|
|
import java.rmi.registry.Registry; |
|
|
|
import java.rmi.server.RMISocketFactory; |
|
|
|
import java.rmi.server.UnicastRemoteObject; |
|
|
|
|
|
|
|
/* |
|
|
|
class LoopbackSocketFactory extends RMISocketFactory { |
|
|
|
public ServerSocket createServerSocket(int port) throws IOException { |
|
|
|
return new ServerSocket(port, 5, InetAddress.getByName("127.0.0.1")); |
|
|
|
} |
|
|
|
|
|
|
|
public Socket createSocket(String host, int port) throws IOException { |
|
|
|
// just call the default client socket factory |
|
|
|
return RMISocketFactory.getDefaultSocketFactory() |
|
|
|
.createSocket(host, port); |
|
|
|
} |
|
|
|
} |
|
|
|
*/ |
|
|
|
|
|
|
|
class Complex { |
|
|
|
double r; |
|
|
|
double i; |
|
|
@ -45,6 +64,8 @@ public class RMIMandelbrotCalculationsServer implements RMIMandelbrotCalculation |
|
|
|
public static void main(String args[]) { |
|
|
|
|
|
|
|
try { |
|
|
|
//RMISocketFactory.setSocketFactory(new LoopbackSocketFactory()); |
|
|
|
|
|
|
|
RMIMandelbrotCalculationsServer obj = new RMIMandelbrotCalculationsServer(); |
|
|
|
RMIMandelbrotCalculationsInterface stub = (RMIMandelbrotCalculationsInterface) UnicastRemoteObject.exportObject(obj, 0); |
|
|
|
|
|
|
@ -127,4 +148,4 @@ public class RMIMandelbrotCalculationsServer implements RMIMandelbrotCalculation |
|
|
|
this.LRy = LRy; |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |