From 76e39dcf01a098877f2e2d21f7d0b027a581915b Mon Sep 17 00:00:00 2001
From: jvergara <jvergara@localhost>
Date: Wed, 04 Jun 2008 11:37:36 +0000
Subject: [PATCH] Complementary fix for issue 3272. When we cannot connect using the host name provided or retrieved using InetAddress, try to connect to localhost and if this fails, try to connect to 0.0.0.0.
---
opends/src/quicksetup/org/opends/quicksetup/util/ServerController.java | 14 +++++++++++++-
1 files changed, 13 insertions(+), 1 deletions(-)
diff --git a/opends/src/quicksetup/org/opends/quicksetup/util/ServerController.java b/opends/src/quicksetup/org/opends/quicksetup/util/ServerController.java
index abcb384..1a47153 100644
--- a/opends/src/quicksetup/org/opends/quicksetup/util/ServerController.java
+++ b/opends/src/quicksetup/org/opends/quicksetup/util/ServerController.java
@@ -427,6 +427,18 @@
InitialLdapContext ctx = null;
for (int i=0; i<20 && !connected; i++)
{
+ if ((i == 10) && !"localhost".equals(hostName))
+ {
+ // Try with local host. This might be necessary in certain
+ // network configurations.
+ ldapUrl = "ldap://localhost:" + port;
+ }
+ if (i == 15)
+ {
+ // Try with 0.0.0.0. This might be necessary in certain
+ // network configurations.
+ ldapUrl = "ldap://0.0.0.0:" + port;
+ }
try
{
ctx = Utils.createLdapContext(
@@ -456,7 +468,7 @@
{
try
{
- Thread.sleep(5000);
+ Thread.sleep(7500);
}
catch (Throwable t)
{
--
Gitblit v1.10.0