ViewVC Help
View File | Revision Log | Show Annotations | Revision Graph | Root Listing
root/i-scream/projects/cms/source/host/java/Config.java
(Generate patch)

Comparing projects/cms/source/host/java/Config.java (file contents):
Revision 1.3 by ab11, Thu Nov 30 04:06:52 2000 UTC vs.
Revision 1.4 by ab11, Thu Nov 30 17:32:18 2000 UTC

# Line 52 | Line 52 | class Config {
52          myProperties = new HashMap();
53          configChanged = false;
54          
55 +        // time in seconds before first retry
56 +        filterManagerRetryTime = 10;
57      
58          // do the funky jibble
59          connect(serverName, serverPort);
# Line 146 | Line 148 | class Config {
148                  filterName = tok.nextToken();
149                  filterUDPPort = Integer.parseInt(tok.nextToken());
150                  filterTCPPort = Integer.parseInt(tok.nextToken());
151 <                    
151 >                                    
152                  sendCommand("END");        
153                  
154              }
# Line 164 | Line 166 | class Config {
166          catch ( IOException e ){
167              // what to do
168              System.out.println("Unable to read from socket, might not be open");
169 +            System.out.println("Retrying in "+filterManagerRetryTime+" seconds");
170 +            configChanged = true;
171 +            try {
172 +                Thread.sleep(filterManagerRetryTime*1000);
173 +            }
174 +            catch( InterruptedException f ){
175 +                System.out.println("Sleep interrupted");
176 +            }
177 +            filterManagerRetryTime = filterManagerRetryTime * 2;
178 +            // warning this WILL cause a stack overflow after a while..
179 +            // need to fix it.
180 +            connect(serverName, serverPort);
181          }
182              
183      } // connect
# Line 198 | Line 212 | class Config {
212          catch ( IOException e ){
213              // what to do
214              System.out.println("Unable to read from socket, might not be open");
215 +            System.out.println("Re-establishing contact with filter manager");
216 +            configChanged = true;
217          }
218      }
219  
# Line 237 | Line 253 | class Config {
253      private ArrayList aList;
254      private BufferedReader socketIn;
255      private PrintWriter socketOut;
256 +    private int filterManagerRetryTime;
257      
258  
259  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines