summaryrefslogtreecommitdiff
path: root/java/test/Ice/binding/RemoteCommunicatorI.java
diff options
context:
space:
mode:
authorBenoit Foucher <benoit@zeroc.com>2008-04-08 16:35:27 +0200
committerBenoit Foucher <benoit@zeroc.com>2008-04-08 16:35:27 +0200
commitf04d724c3820f49aab007e535100ccd1d7f731fa (patch)
tree3647e42353feeafc5c55c7f5f450ea16093c1242 /java/test/Ice/binding/RemoteCommunicatorI.java
parentFixed bug 2951 (diff)
downloadice-f04d724c3820f49aab007e535100ccd1d7f731fa.tar.bz2
ice-f04d724c3820f49aab007e535100ccd1d7f731fa.tar.xz
ice-f04d724c3820f49aab007e535100ccd1d7f731fa.zip
Fixed bug 2896
Diffstat (limited to 'java/test/Ice/binding/RemoteCommunicatorI.java')
-rw-r--r--java/test/Ice/binding/RemoteCommunicatorI.java11
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;
}