diff --git a/htroot/ConfigBasic.html b/htroot/ConfigBasic.html
index 075924da5..3dc64426a 100644
--- a/htroot/ConfigBasic.html
+++ b/htroot/ConfigBasic.html
@@ -13,7 +13,7 @@
-->
- #(reconnect)#::#(/reconnect)#
+ #(reconnect)#::#(/reconnect)#
#(changedLanguage)#::#(/changedLanguage)#
@@ -118,6 +118,8 @@
+
+ #(reconnect)#::Your Browser will reload the YaCy UI with the new port in 5 seconds...
#(/reconnect)#
diff --git a/htroot/ConfigBasic.java b/htroot/ConfigBasic.java
index 85e8df6fa..cf8a52bbe 100644
--- a/htroot/ConfigBasic.java
+++ b/htroot/ConfigBasic.java
@@ -173,8 +173,8 @@ public class ConfigBasic {
//yacyAccessible.setNewPortBat(Integer.parseInt(port));
//yacyAccessible.setNewPortLink(Integer.parseInt(port));
- // force reconnection in 5 seconds
- theServerCore.reconnect(5000);
+ // force reconnection in 2 seconds
+ theServerCore.reconnect(2000);
} else {
reconnect = false;
prop.put("reconnect", "0");
diff --git a/source/net/yacy/http/Jetty9HttpServerImpl.java b/source/net/yacy/http/Jetty9HttpServerImpl.java
index 7b1c1b107..0780453d6 100644
--- a/source/net/yacy/http/Jetty9HttpServerImpl.java
+++ b/source/net/yacy/http/Jetty9HttpServerImpl.java
@@ -325,14 +325,19 @@ public class Jetty9HttpServerImpl implements YaCyHttpServer {
@Override
public void run() {
- try {
+ if (milsec > 0) try {
Thread.sleep(milsec);
} catch (final InterruptedException e) {
ConcurrentLog.logException(e);
} catch (final Exception e) {
ConcurrentLog.logException(e);
}
- try { // reconnect with new settings (instead to stop/start server, just manipulate connectors
+ try {
+ if (!server.isRunning() || server.isStopped()) {
+ server.start();
+ }
+
+ // reconnect with new settings (instead to stop/start server, just manipulate connectors
final Connector[] cons = server.getConnectors();
final int port = Switchboard.getSwitchboard().getLocalPort();
final int sslport = Switchboard.getSwitchboard().getConfigInt(SwitchboardConstants.SERVER_SSLPORT, 8443);
@@ -512,4 +517,9 @@ public class Jetty9HttpServerImpl implements YaCyHttpServer {
return null;
}
}
+
+ @Override
+ public String toString() {
+ return this.server.dump() + "\n\n" + this.server.getState();
+ }
}