fixed server port change

git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@4826 6c8d7289-2bf4-0310-a012-ef5d649a1542
pull/1/head
orbiter 17 years ago
parent 53dfe9fe9a
commit 6aa9bf43f9

@ -141,7 +141,7 @@ public class SettingsAck_p {
env.setConfig("port", port); env.setConfig("port", port);
theServerCore.reconnect(); theServerCore.reconnect(5000);
} catch (SocketException e) { } catch (SocketException e) {
prop.put("info", "26"); prop.put("info", "26");
return prop; return prop;

@ -440,7 +440,7 @@ public final class serverCore extends serverAbstractBusyThread implements server
s.interrupt(); s.interrupt();
s.close(); s.close();
} }
this.busySessions = null; this.busySessions.clear();
this.log.logConfig("* terminated"); this.log.logConfig("* terminated");
} }
@ -918,11 +918,9 @@ public final class serverCore extends serverAbstractBusyThread implements server
if (currentThread.isInterrupted()) throw new InterruptedException(); if (currentThread.isInterrupted()) throw new InterruptedException();
if ((currentThread instanceof serverCore.Session) && ((serverCore.Session)currentThread).isStopped()) throw new InterruptedException(); if ((currentThread instanceof serverCore.Session) && ((serverCore.Session)currentThread).isStopped()) throw new InterruptedException();
} }
public void reconnect() {
this.reconnect(5000);
}
public void reconnect(int delay) { public void reconnect(int delay) {
Thread restart = new Restarter(); Thread restart = new Restarter(delay);
restart.start(); restart.start();
} }
@ -930,6 +928,9 @@ public final class serverCore extends serverAbstractBusyThread implements server
public class Restarter extends Thread { public class Restarter extends Thread {
public serverCore theServerCore = null; public serverCore theServerCore = null;
public int delay = 5000; public int delay = 5000;
public Restarter(int delay) {
this.delay = delay;
}
public void run() { public void run() {
// waiting for a while // waiting for a while
try { try {
@ -940,10 +941,10 @@ public final class serverCore extends serverAbstractBusyThread implements server
} }
// signaling restart // signaling restart
serverCore.this.forceRestart = true; forceRestart = true;
// closing socket to notify the thread // closing socket to notify the thread
serverCore.this.close(); close();
} }
} }

Loading…
Cancel
Save