--- projects/cms/source/host/java/Config.java 2000/11/30 04:06:52 1.3 +++ projects/cms/source/host/java/Config.java 2000/11/30 17:32:18 1.4 @@ -12,7 +12,7 @@ import java.io.*; * configuration * * @author $Author: ab11 $ - * @version $Id: Config.java,v 1.3 2000/11/30 04:06:52 ab11 Exp $ + * @version $Id: Config.java,v 1.4 2000/11/30 17:32:18 ab11 Exp $ */ class Config { @@ -52,6 +52,8 @@ class Config { myProperties = new HashMap(); configChanged = false; + // time in seconds before first retry + filterManagerRetryTime = 10; // do the funky jibble connect(serverName, serverPort); @@ -146,7 +148,7 @@ class Config { filterName = tok.nextToken(); filterUDPPort = Integer.parseInt(tok.nextToken()); filterTCPPort = Integer.parseInt(tok.nextToken()); - + sendCommand("END"); } @@ -164,6 +166,18 @@ class Config { catch ( IOException e ){ // what to do System.out.println("Unable to read from socket, might not be open"); + System.out.println("Retrying in "+filterManagerRetryTime+" seconds"); + configChanged = true; + try { + Thread.sleep(filterManagerRetryTime*1000); + } + catch( InterruptedException f ){ + System.out.println("Sleep interrupted"); + } + filterManagerRetryTime = filterManagerRetryTime * 2; + // warning this WILL cause a stack overflow after a while.. + // need to fix it. + connect(serverName, serverPort); } } // connect @@ -198,6 +212,8 @@ class Config { catch ( IOException e ){ // what to do System.out.println("Unable to read from socket, might not be open"); + System.out.println("Re-establishing contact with filter manager"); + configChanged = true; } } @@ -237,6 +253,7 @@ class Config { private ArrayList aList; private BufferedReader socketIn; private PrintWriter socketOut; + private int filterManagerRetryTime;