summaryrefslogtreecommitdiff
path: root/cpp
diff options
context:
space:
mode:
authorBenoit Foucher <benoit@zeroc.com>2017-03-24 18:24:34 +0100
committerBenoit Foucher <benoit@zeroc.com>2017-03-24 18:24:34 +0100
commit14661bc0d8fd391a035ff92f65d2fe3dbd1ce40b (patch)
tree711809e55c6ae04d36a0f4f1af349eae5a612c51 /cpp
parentFixed JS objects test failure with Firefox (diff)
downloadice-14661bc0d8fd391a035ff92f65d2fe3dbd1ce40b.tar.bz2
ice-14661bc0d8fd391a035ff92f65d2fe3dbd1ce40b.tar.xz
ice-14661bc0d8fd391a035ff92f65d2fe3dbd1ce40b.zip
Fixes for udp and IceDiscovery demos
Diffstat (limited to 'cpp')
-rw-r--r--cpp/test/Ice/udp/AllTests.cpp11
-rw-r--r--cpp/test/Ice/udp/Server.cpp13
2 files changed, 11 insertions, 13 deletions
diff --git a/cpp/test/Ice/udp/AllTests.cpp b/cpp/test/Ice/udp/AllTests.cpp
index 431271cd3e7..fbb4e7ea083 100644
--- a/cpp/test/Ice/udp/AllTests.cpp
+++ b/cpp/test/Ice/udp/AllTests.cpp
@@ -134,20 +134,19 @@ allTests(const CommunicatorPtr& communicator)
cout << "ok" << endl;
- string endpoint;
+ ostringstream endpoint;
if(communicator->getProperties()->getProperty("Ice.IPv6") == "1")
{
+ endpoint << "udp -h \"ff15::1:1\" -p " << getTestPort(communicator->getProperties(), 10);
#ifdef __APPLE__
- endpoint = "udp -h \"ff15::1:1\" -p 12020 --interface \"::1\"";
-#else
- endpoint = "udp -h \"ff15::1:1\" -p 12020";
+ endpoint << " --interface \"::1\"";
#endif
}
else
{
- endpoint = "udp -h 239.255.1.1 -p 12020";
+ endpoint << "udp -h 239.255.1.1 -p " << getTestPort(communicator->getProperties(), 10);
}
- base = communicator->stringToProxy("test -d:" + endpoint);
+ base = communicator->stringToProxy("test -d:" + endpoint.str());
TestIntfPrxPtr objMcast = ICE_UNCHECKED_CAST(TestIntfPrx, base);
#if (!defined(__APPLE__) || (defined(__APPLE__) && !TARGET_OS_IPHONE))
cout << "testing udp multicast... " << flush;
diff --git a/cpp/test/Ice/udp/Server.cpp b/cpp/test/Ice/udp/Server.cpp
index 29b108f60c3..6643dc76d95 100644
--- a/cpp/test/Ice/udp/Server.cpp
+++ b/cpp/test/Ice/udp/Server.cpp
@@ -35,20 +35,19 @@ run(int argc, char* argv[], const Ice::CommunicatorPtr& communicator)
adapter2->activate();
}
- string endpoint;
+ ostringstream endpoint;
if(properties->getProperty("Ice.IPv6") == "1")
{
-#ifndef __APPLE__
- endpoint = "udp -h \"ff15::1:1\" -p 12020";
-#else
- endpoint = "udp -h \"ff15::1:1\" -p 12020 --interface \"::1\"";
+ endpoint << "udp -h \"ff15::1:1\" -p " << getTestPort(properties, 10);
+#ifdef __APPLE__
+ endpoint << " --interface \"::1\"";
#endif
}
else
{
- endpoint = "udp -h 239.255.1.1 -p 12020";
+ endpoint << "udp -h 239.255.1.1 -p " << getTestPort(properties, 10);
}
- properties->setProperty("McastTestAdapter.Endpoints", endpoint);
+ properties->setProperty("McastTestAdapter.Endpoints", endpoint.str());
Ice::ObjectAdapterPtr mcastAdapter = communicator->createObjectAdapter("McastTestAdapter");
mcastAdapter->add(ICE_MAKE_SHARED(TestIntfI), Ice::stringToIdentity("test"));
mcastAdapter->activate();