Changeset 19241

Show
Ignore:
Timestamp:
23.04.2009 18:44:02 (10 years ago)
Author:
ak19
Message:

Timeout length set in a variable. Can be changed (but better to be consistent with GLI's LocalLibraryServer?.java code).

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • greenstone3/trunk/src/java/org/greenstone/server/Server2.java

    r19022 r19241  
    2222public class Server2 extends BaseServer  
    2323{ 
     24    private static final int WAITING_TIME = 60; // time to wait and check for whether the server is running 
     25 
    2426    protected String libraryURL; 
    2527 
     
    3638 
    3739    public void run() { 
    38         // Server2.this.recordSuccess("In QuitListener.run()"); 
    39  
    4040        Socket connection = null; 
    4141 
     
    4343        // wait for a connection 
    4444        connection = serverSocket.accept(); 
    45  
    46         ///Server2.this.recordSuccess("In QuitListener - accepted connection"); 
    4745 
    4846        // read input 
     
    5149            String line = null; 
    5250            if((line = reader.readLine()) != null) { 
    53             // Server2.this.recordSuccess("In QuitListener - Got a line"); 
    5451            if(line.equals("QUIT")) { 
    5552                // Server2.this.recordSuccess("In QuitListener - line is QUIT"); 
     
    269266 
    270267        boolean ready = false;  
    271         for(int i = 0; i < 60 && !ready; i++) { 
     268        for(int i = 0; i < WAITING_TIME && !ready; i++) { 
    272269        try { 
    273270            libURL.openConnection();