[Remoterengine-commits] r131 - pkg/RemoteREngine/inst/java_src/src/server/org/rosuda/REngine/remote/server

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Tue Sep 15 13:02:14 CEST 2009


Author: ian_long
Date: 2009-09-15 13:02:11 +0200 (Tue, 15 Sep 2009)
New Revision: 131

Modified:
   pkg/RemoteREngine/inst/java_src/src/server/org/rosuda/REngine/remote/server/RemoteREngine_Server.java
Log:
Ensure service listens on the specified port

Modified: pkg/RemoteREngine/inst/java_src/src/server/org/rosuda/REngine/remote/server/RemoteREngine_Server.java
===================================================================
--- pkg/RemoteREngine/inst/java_src/src/server/org/rosuda/REngine/remote/server/RemoteREngine_Server.java	2009-09-15 10:19:45 UTC (rev 130)
+++ pkg/RemoteREngine/inst/java_src/src/server/org/rosuda/REngine/remote/server/RemoteREngine_Server.java	2009-09-15 11:02:11 UTC (rev 131)
@@ -165,10 +165,6 @@
 				r.globalEnv, r.emptyEnv, r.baseEnv, 
 				r.nullValueRef, r.nullValue,r.hashCode() ) ;
 		
-		// TODO Add a mechanism to allow the user to set the port number
-		// for the server to support controlled access through firewalls
-		int serverPort = RemoteREngineConstants.DEFAULTSERVERPORT;
-		
 		try {
 			// Locate a local registry as RMI Servers can't register with Remote Registries
 			registry = LocateRegistry.getRegistry(null, registryPort);
@@ -187,9 +183,9 @@
 
 		RemoteREngineInterface stub = null;
 		try {
-			stub = (RemoteREngineInterface)UnicastRemoteObject.exportObject(this,serverPort);
+			stub = (RemoteREngineInterface)UnicastRemoteObject.exportObject(this,servicePort);
 		} catch (RemoteException e) {
-			System.err.println("Unable to serialize server on " + serverPort + ": " + e.getMessage());
+			System.err.println("Unable to serialize server on " + servicePort + ": " + e.getMessage());
 			throw e;
 		}
 
@@ -203,15 +199,15 @@
 				System.err.println("AccessException while rebinding server to registry: " + ae.getMessage());
 				throw ae;
 			}catch (RemoteException re) {
-				System.err.println("Unable to rebind server to port " + serverPort + ": " + re.getMessage());
+				System.err.println("Unable to rebind server to port " + servicePort + ": " + re.getMessage());
 				throw re;
 			}
 		} catch (RemoteException e) {
-			System.err.println("Unable to bind server(" + name + ") to port " + serverPort + ": " + e.getMessage());
+			System.err.println("Unable to bind server(" + name + ") to port " + servicePort + ": " + e.getMessage());
 			throw e;
 		}
 
-		System.out.println( "R Engine bound as `"+ name +"` as a service on port " + serverPort + " to local RMIRegistry running on port " + registryPort );
+		System.out.println( "R Engine bound as `"+ name +"` as a service on port " + servicePort + " to local RMIRegistry running on port " + registryPort );
 		running = true; 
 	}
 



More information about the Remoterengine-commits mailing list