diff options
Diffstat (limited to 'java/test/Ice/binding/RemoteCommunicatorI.java')
-rw-r--r-- | java/test/Ice/binding/RemoteCommunicatorI.java | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/java/test/Ice/binding/RemoteCommunicatorI.java b/java/test/Ice/binding/RemoteCommunicatorI.java index 60eb19fedbf..9d7531d6263 100644 --- a/java/test/Ice/binding/RemoteCommunicatorI.java +++ b/java/test/Ice/binding/RemoteCommunicatorI.java @@ -12,8 +12,15 @@ import Test.*; public class RemoteCommunicatorI extends _RemoteCommunicatorDisp { public RemoteObjectAdapterPrx - createObjectAdapter(String name, String endpoints, Ice.Current current) + createObjectAdapter(String name, String endpts, Ice.Current current) { + String endpoints = endpts; + if(endpoints.indexOf("-p") < 0) + { + // Use a fixed port if none is specified (bug 2896) + endpoints = endpoints + " -h 127.0.0.1 -p " + _nextPort++; + } + Ice.Communicator com = current.adapter.getCommunicator(); com.getProperties().setProperty(name + ".ThreadPool.Size", "1"); Ice.ObjectAdapter adapter = com.createObjectAdapterWithEndpoints(name, endpoints); @@ -32,4 +39,6 @@ public class RemoteCommunicatorI extends _RemoteCommunicatorDisp { current.adapter.getCommunicator().shutdown(); } + + private int _nextPort = 10001; } |