diff options
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); |