summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--cpp/test/Ice/udp/AllTests.cpp7
-rw-r--r--cpp/test/Ice/udp/Server.cpp4
-rw-r--r--csharp/test/Ice/udp/AllTests.cs4
-rw-r--r--csharp/test/Ice/udp/Server.cs4
-rw-r--r--java-compat/test/src/main/java/test/Ice/udp/AllTests.java10
-rw-r--r--java-compat/test/src/main/java/test/Ice/udp/Server.java8
-rw-r--r--java/test/src/main/java/test/Ice/udp/AllTests.java10
-rw-r--r--java/test/src/main/java/test/Ice/udp/Server.java10
8 files changed, 42 insertions, 15 deletions
diff --git a/cpp/test/Ice/udp/AllTests.cpp b/cpp/test/Ice/udp/AllTests.cpp
index 450d6e6c9f5..863509f403a 100644
--- a/cpp/test/Ice/udp/AllTests.cpp
+++ b/cpp/test/Ice/udp/AllTests.cpp
@@ -138,13 +138,16 @@ allTests(const CommunicatorPtr& communicator)
if(communicator->getProperties()->getProperty("Ice.IPv6") == "1")
{
endpoint << "udp -h \"ff15::1:1\" -p " << getTestPort(communicator->getProperties(), 10);
-#ifdef __APPLE__
- endpoint << " --interface \"::1\"";
+#if defined(__APPLE__) || defined(_WIN32)
+ endpoint << " --interface \"::1\""; // Use loopback to prevent other machines to answer. the multicast requests.
#endif
}
else
{
endpoint << "udp -h 239.255.1.1 -p " << getTestPort(communicator->getProperties(), 10);
+#if defined(__APPLE__) || defined(_WIN32)
+ endpoint << " --interface 127.0.0.1"; // Use loopback to prevent other machines to answer.
+#endif
}
base = communicator->stringToProxy("test -d:" + endpoint.str());
TestIntfPrxPtr objMcast = ICE_UNCHECKED_CAST(TestIntfPrx, base);
diff --git a/cpp/test/Ice/udp/Server.cpp b/cpp/test/Ice/udp/Server.cpp
index 83b26ea58fb..37ab0c72b63 100644
--- a/cpp/test/Ice/udp/Server.cpp
+++ b/cpp/test/Ice/udp/Server.cpp
@@ -40,14 +40,14 @@ run(int argc, char* argv[], const Ice::CommunicatorPtr& communicator)
{
endpoint << "udp -h \"ff15::1:1\" -p " << getTestPort(properties, 10);
#if defined(__APPLE__) || defined(_WIN32)
- endpoint << " --interface \"::1\"";
+ endpoint << " --interface \"::1\""; // Use loopback to prevent other machines to answer.
#endif
}
else
{
endpoint << "udp -h 239.255.1.1 -p " << getTestPort(properties, 10);
#if defined(__APPLE__) || defined(_WIN32)
- endpoint << " --interface 127.0.0.1";
+ endpoint << " --interface 127.0.0.1"; // Use loopback to prevent other machines to answer.
#endif
}
properties->setProperty("McastTestAdapter.Endpoints", endpoint.str());
diff --git a/csharp/test/Ice/udp/AllTests.cs b/csharp/test/Ice/udp/AllTests.cs
index 12a7c8c2405..6b2dcfb8b31 100644
--- a/csharp/test/Ice/udp/AllTests.cs
+++ b/csharp/test/Ice/udp/AllTests.cs
@@ -159,11 +159,11 @@ public class AllTests
StringBuilder endpoint = new StringBuilder();
if(communicator.getProperties().getProperty("Ice.IPv6").Equals("1"))
{
- endpoint.Append("udp -h \"ff15::1:1\" -p ");
+ endpoint.Append("udp -h \"ff15::1:1\" --interface \"::1\" -p "); // Use loopback to prevent other machines to answer.
}
else
{
- endpoint.Append("udp -h 239.255.1.1 -p ");
+ endpoint.Append("udp -h 239.255.1.1 --interface 127.0.0.1 -p "); // Use loopback to prevent other machines to answer.
}
endpoint.Append(app.getTestPort(10));
@base = communicator.stringToProxy("test -d:" + endpoint.ToString());
diff --git a/csharp/test/Ice/udp/Server.cs b/csharp/test/Ice/udp/Server.cs
index dbffc6f8f11..a366b601ff8 100644
--- a/csharp/test/Ice/udp/Server.cs
+++ b/csharp/test/Ice/udp/Server.cs
@@ -47,11 +47,11 @@ public class Server : TestCommon.Application
StringBuilder endpoint = new StringBuilder();
if(properties.getProperty("Ice.IPv6").Equals("1"))
{
- endpoint.Append("udp -h \"ff15::1:1\" -p ");
+ endpoint.Append("udp -h \"ff15::1:1\" --interface \"::1\" -p "); // Use loopback to prevent other machines to answer.
}
else
{
- endpoint.Append("udp -h 239.255.1.1 -p ");
+ endpoint.Append("udp -h 239.255.1.1 --interface 127.0.0.1 -p "); // Use loopback to prevent other machines to answer.
}
endpoint.Append(getTestPort(properties, 10));
properties.setProperty("McastTestAdapter.Endpoints", endpoint.ToString());
diff --git a/java-compat/test/src/main/java/test/Ice/udp/AllTests.java b/java-compat/test/src/main/java/test/Ice/udp/AllTests.java
index d035f5b5564..05d45560b67 100644
--- a/java-compat/test/src/main/java/test/Ice/udp/AllTests.java
+++ b/java-compat/test/src/main/java/test/Ice/udp/AllTests.java
@@ -170,15 +170,21 @@ public class AllTests
{
endpoint.append("udp -h \"ff15::1:1\" -p ");
endpoint.append(app.getTestPort(communicator.getProperties(), 10));
- if(System.getProperty("os.name").contains("OS X"))
+ if(System.getProperty("os.name").contains("OS X") ||
+ System.getProperty("os.name").startsWith("Windows"))
{
- endpoint.append(" --interface \"::1\"");
+ endpoint.append(" --interface \"::1\""); // Use loopback to prevent other machines to answer.
}
}
else
{
endpoint.append("udp -h 239.255.1.1 -p ");
endpoint.append(app.getTestPort(communicator.getProperties(), 10));
+ if(System.getProperty("os.name").contains("OS X") ||
+ System.getProperty("os.name").startsWith("Windows"))
+ {
+ endpoint.append(" --interface 127.0.0.1"); // Use loopback to prevent other machines to answer.
+ }
}
base = communicator.stringToProxy("test -d:" + endpoint.toString());
TestIntfPrx objMcast = TestIntfPrxHelper.uncheckedCast(base);
diff --git a/java-compat/test/src/main/java/test/Ice/udp/Server.java b/java-compat/test/src/main/java/test/Ice/udp/Server.java
index a88ffe40551..c8412dc6830 100644
--- a/java-compat/test/src/main/java/test/Ice/udp/Server.java
+++ b/java-compat/test/src/main/java/test/Ice/udp/Server.java
@@ -42,7 +42,8 @@ public class Server extends test.Util.Application
{
endpoint.append("udp -h \"ff15::1:1\" -p ");
endpoint.append(getTestPort(properties, 10));
- if(System.getProperty("os.name").contains("OS X"))
+ if(System.getProperty("os.name").contains("OS X") ||
+ System.getProperty("os.name").startsWith("Windows"))
{
endpoint.append(" --interface \"::1\"");
}
@@ -51,6 +52,11 @@ public class Server extends test.Util.Application
{
endpoint.append("udp -h 239.255.1.1 -p ");
endpoint.append(getTestPort(properties, 10));
+ if(System.getProperty("os.name").contains("OS X") ||
+ System.getProperty("os.name").startsWith("Windows"))
+ {
+ endpoint.append(" --interface 127.0.0.1");
+ }
}
properties.setProperty("McastTestAdapter.Endpoints", endpoint.toString());
Ice.ObjectAdapter mcastAdapter = communicator().createObjectAdapter("McastTestAdapter");
diff --git a/java/test/src/main/java/test/Ice/udp/AllTests.java b/java/test/src/main/java/test/Ice/udp/AllTests.java
index 70f0d7ae290..398e6c10c84 100644
--- a/java/test/src/main/java/test/Ice/udp/AllTests.java
+++ b/java/test/src/main/java/test/Ice/udp/AllTests.java
@@ -154,15 +154,21 @@ public class AllTests
{
endpoint.append("udp -h \"ff15::1:1\" -p ");
endpoint.append(app.getTestPort(communicator.getProperties(), 10));
- if(System.getProperty("os.name").contains("OS X"))
+ if(System.getProperty("os.name").contains("OS X") ||
+ System.getProperty("os.name").startsWith("Windows"))
{
- endpoint.append(" --interface \"::1\"");
+ endpoint.append(" --interface \"::1\""); // Use loopback to prevent other machines to answer.
}
}
else
{
endpoint.append("udp -h 239.255.1.1 -p ");
endpoint.append(app.getTestPort(communicator.getProperties(), 10));
+ if(System.getProperty("os.name").contains("OS X") ||
+ System.getProperty("os.name").startsWith("Windows"))
+ {
+ endpoint.append(" --interface 127.0.0.1"); // Use loopback to prevent other machines to answer.
+ }
}
base = communicator.stringToProxy("test -d:" + endpoint.toString());
TestIntfPrx objMcast = TestIntfPrx.uncheckedCast(base);
diff --git a/java/test/src/main/java/test/Ice/udp/Server.java b/java/test/src/main/java/test/Ice/udp/Server.java
index 8ce0b1d07a9..30e418fb09e 100644
--- a/java/test/src/main/java/test/Ice/udp/Server.java
+++ b/java/test/src/main/java/test/Ice/udp/Server.java
@@ -43,15 +43,21 @@ public class Server extends test.Util.Application
{
endpoint.append("udp -h \"ff15::1:1\" -p ");
endpoint.append(getTestPort(properties, 10));
- if(System.getProperty("os.name").contains("OS X"))
+ if(System.getProperty("os.name").contains("OS X") ||
+ System.getProperty("os.name").startsWith("Windows"))
{
- endpoint.append(" --interface \"::1\"");
+ endpoint.append(" --interface \"::1\""); // Use loopback to prevent other machines to answer.
}
}
else
{
endpoint.append("udp -h 239.255.1.1 -p ");
endpoint.append(getTestPort(properties, 10));
+ if(System.getProperty("os.name").contains("OS X") ||
+ System.getProperty("os.name").startsWith("Windows"))
+ {
+ endpoint.append(" --interface 127.0.0.1"); // Use loopback to prevent other machines to answer.
+ }
}
properties.setProperty("McastTestAdapter.Endpoints", endpoint.toString());