diff options
author | Benoit Foucher <benoit@zeroc.com> | 2008-04-08 16:35:27 +0200 |
---|---|---|
committer | Benoit Foucher <benoit@zeroc.com> | 2008-04-08 16:35:27 +0200 |
commit | f04d724c3820f49aab007e535100ccd1d7f731fa (patch) | |
tree | 3647e42353feeafc5c55c7f5f450ea16093c1242 /java/test/Ice/binding/RemoteCommunicatorI.java | |
parent | Fixed bug 2951 (diff) | |
download | ice-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.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; } |