summaryrefslogtreecommitdiff
path: root/csharp
diff options
context:
space:
mode:
authorBenoit Foucher <benoit@zeroc.com>2015-08-14 07:19:13 +0200
committerBenoit Foucher <benoit@zeroc.com>2015-08-14 07:19:13 +0200
commitb0f0bc95d4db337fa4250dd8c320d921908f55a2 (patch)
tree477644c3b5b3822f4d12a5a269406d2928aebf2e /csharp
parentAnother minor fix for Expect.py script (diff)
downloadice-b0f0bc95d4db337fa4250dd8c320d921908f55a2.tar.bz2
ice-b0f0bc95d4db337fa4250dd8c320d921908f55a2.tar.xz
ice-b0f0bc95d4db337fa4250dd8c320d921908f55a2.zip
Revert "Fixed ICE-6707 - default interface for discovery is now Ice.Default.Host if it is set"
This reverts commit 406e393f2be3a29830a7758e58e4e674afc5e21e.
Diffstat (limited to 'csharp')
-rwxr-xr-xcsharp/allTests.py1
-rw-r--r--csharp/src/IceDiscovery/PluginI.cs22
-rw-r--r--csharp/src/IceLocatorDiscovery/PluginI.cs22
-rwxr-xr-xcsharp/test/IceDiscovery/simple/run.py3
-rw-r--r--csharp/test/IceGrid/simple/AllTests.cs13
5 files changed, 12 insertions, 49 deletions
diff --git a/csharp/allTests.py b/csharp/allTests.py
index 2e5329b6403..2e5b846b4bb 100755
--- a/csharp/allTests.py
+++ b/csharp/allTests.py
@@ -73,7 +73,6 @@ tests = [
("IceBox/configuration", ["core", "noipv6", "nomx"]),
("Glacier2/router", ["service"]),
("Glacier2/sessionHelper", ["core"]),
- ("IceDiscovery/simple", ["service"]),
("IceGrid/simple", ["service"]),
("IceSSL/configuration", ["once", "novista", "nomono", "nocompact"]),
]
diff --git a/csharp/src/IceDiscovery/PluginI.cs b/csharp/src/IceDiscovery/PluginI.cs
index 0c09c4884a7..69e3a6c0667 100644
--- a/csharp/src/IceDiscovery/PluginI.cs
+++ b/csharp/src/IceDiscovery/PluginI.cs
@@ -12,7 +12,6 @@ namespace IceDiscovery
using System;
using System.Text;
using System.Collections.Generic;
- using System.Net;
public sealed class PluginFactory : Ice.PluginFactory
{
@@ -48,27 +47,6 @@ namespace IceDiscovery
}
int port = properties.getPropertyAsIntWithDefault("IceDiscovery.Port", 4061);
string intf = properties.getProperty("IceDiscovery.Interface");
- string defaultHost = properties.getProperty("Ice.Default.Host");
- if(intf.Length == 0 && defaultHost.Length > 0)
- {
- //
- // Make sure the interface is an IP address, the UDP --interface option
- // doesn't support DNS names.
- //
- int protocol = ipv4 && !preferIPv6 ? IceInternal.Network.EnableIPv4 : IceInternal.Network.EnableIPv6;
- try
- {
- EndPoint addr = IceInternal.Network.getAddressForServer(defaultHost, 0, protocol, preferIPv6);
- if(addr != null)
- {
- intf = IceInternal.Network.endpointAddressToString(addr);
- }
- }
- catch(Ice.LocalException)
- {
- // Ignore
- }
- }
if(properties.getProperty("IceDiscovery.Multicast.Endpoints").Length == 0)
{
diff --git a/csharp/src/IceLocatorDiscovery/PluginI.cs b/csharp/src/IceLocatorDiscovery/PluginI.cs
index 3c9f9b3628f..ccf9b266850 100644
--- a/csharp/src/IceLocatorDiscovery/PluginI.cs
+++ b/csharp/src/IceLocatorDiscovery/PluginI.cs
@@ -13,7 +13,6 @@ namespace IceLocatorDiscovery
using System.Collections.Generic;
using System.Diagnostics;
using System.Text;
- using System.Net;
public sealed class PluginFactory : Ice.PluginFactory
{
@@ -374,27 +373,6 @@ namespace IceLocatorDiscovery
}
int port = properties.getPropertyAsIntWithDefault("IceLocatorDiscovery.Port", 4061);
string intf = properties.getProperty("IceLocatorDiscovery.Interface");
- string defaultHost = properties.getProperty("Ice.Default.Host");
- if(intf.Length == 0 && defaultHost.Length > 0)
- {
- //
- // Make sure the interface is an IP address, the UDP --interface option
- // doesn't support DNS names.
- //
- int protocol = ipv4 && !preferIPv6 ? IceInternal.Network.EnableIPv4 : IceInternal.Network.EnableIPv6;
- try
- {
- EndPoint addr = IceInternal.Network.getAddressForServer(defaultHost, 0, protocol, preferIPv6);
- if(addr != null)
- {
- intf = IceInternal.Network.endpointAddressToString(addr);
- }
- }
- catch(Ice.LocalException)
- {
- // Ignore
- }
- }
if(properties.getProperty("IceLocatorDiscovery.Reply.Endpoints").Length == 0)
{
diff --git a/csharp/test/IceDiscovery/simple/run.py b/csharp/test/IceDiscovery/simple/run.py
index fdb42d64382..a8e7fe8242e 100755
--- a/csharp/test/IceDiscovery/simple/run.py
+++ b/csharp/test/IceDiscovery/simple/run.py
@@ -33,6 +33,9 @@ if TestUtil.isDarwin() and TestUtil.ipv6:
print("test not supported on OS X with IPv6")
sys.exit(0)
+if not TestUtil.ipv6:
+ args += " --IceDiscovery.Interface=127.0.0.1"
+
serverProc = []
for i in range(0, num):
sys.stdout.write("starting server #%d... " % (i + 1))
diff --git a/csharp/test/IceGrid/simple/AllTests.cs b/csharp/test/IceGrid/simple/AllTests.cs
index 40d826e5cab..96af8c4bdb3 100644
--- a/csharp/test/IceGrid/simple/AllTests.cs
+++ b/csharp/test/IceGrid/simple/AllTests.cs
@@ -63,7 +63,7 @@ public class AllTests
IceGrid.RegistryPrx registry = IceGrid.RegistryPrxHelper.checkedCast(
communicator.stringToProxy(communicator.getDefaultLocator().ice_getIdentity().category + "/Registry"));
test(registry != null);
-
+
try
{
IceGrid.AdminSessionPrx session = registry.createAdminSession("foo", "bar");
@@ -82,11 +82,16 @@ public class AllTests
Ice.InitializationData initData = new Ice.InitializationData();
initData.properties = communicator.getProperties().ice_clone_();
initData.properties.setProperty("Ice.Default.Locator", "");
- initData.properties.setProperty("Ice.Plugin.IceLocatorDiscovery",
+ initData.properties.setProperty("Ice.Plugin.IceLocatorDiscovery",
"IceLocatorDiscovery:IceLocatorDiscovery.PluginFactory");
+ if(IceInternal.AssemblyUtil.osx_ &&
+ initData.properties.getPropertyAsInt("Ice.PreferIPv6Address") > 0)
+ {
+ initData.properties.setProperty("IceLocatorDiscovery.Interface", "::1");
+ }
initData.properties.setProperty("AdapterForDiscoveryTest.AdapterId", "discoveryAdapter");
initData.properties.setProperty("AdapterForDiscoveryTest.Endpoints", "default");
-
+
Ice.Communicator com = Ice.Util.initialize(initData);
test(com.getDefaultLocator() != null);
com.stringToProxy("test @ TestAdapter").ice_ping();
@@ -104,7 +109,7 @@ public class AllTests
//
// Now, ensure that the IceGrid discovery locator correctly
// handles failure to find a locator.
- //
+ //
initData.properties.setProperty("IceLocatorDiscovery.InstanceName", "unknown");
initData.properties.setProperty("IceLocatorDiscovery.RetryCount", "1");
initData.properties.setProperty("IceLocatorDiscovery.Timeout", "100");