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 /cpp/test/Ice/binding/TestI.cpp | |
parent | Fixed bug 2951 (diff) | |
download | ice-f04d724c3820f49aab007e535100ccd1d7f731fa.tar.bz2 ice-f04d724c3820f49aab007e535100ccd1d7f731fa.tar.xz ice-f04d724c3820f49aab007e535100ccd1d7f731fa.zip |
Fixed bug 2896
Diffstat (limited to 'cpp/test/Ice/binding/TestI.cpp')
-rw-r--r-- | cpp/test/Ice/binding/TestI.cpp | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/cpp/test/Ice/binding/TestI.cpp b/cpp/test/Ice/binding/TestI.cpp index a802fa4565a..38d5aa00a3d 100644 --- a/cpp/test/Ice/binding/TestI.cpp +++ b/cpp/test/Ice/binding/TestI.cpp @@ -14,9 +14,21 @@ using namespace std; using namespace Ice; using namespace Test; +RemoteCommunicatorI::RemoteCommunicatorI() : _nextPort(10001) +{ +} + RemoteObjectAdapterPrx -RemoteCommunicatorI::createObjectAdapter(const string& name, const string& endpoints, const Current& current) +RemoteCommunicatorI::createObjectAdapter(const string& name, const string& endpts, const Current& current) { + string endpoints = endpts; + if(endpoints.find("-p") == string::npos) + { + // Use a fixed port if none is specified (bug 2896) + ostringstream os; + os << endpoints << " -h 127.0.0.1 -p " << _nextPort++; + } + Ice::CommunicatorPtr com = current.adapter->getCommunicator(); com->getProperties()->setProperty(name + ".ThreadPool.Size", "1"); ObjectAdapterPtr adapter = com->createObjectAdapterWithEndpoints(name, endpoints); |