Changeset 19022


Ignore:
Timestamp:
2009-04-16T18:54:13+12:00 (15 years ago)
Author:
ak19
Message:

Rearranging the code that checks for whether a quitport is provided and if so whether it is assignable.

File:
1 edited

Legend:

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

    r18969 r19022  
    9090
    9191    // now we can monitor for the quit command if applicable
    92     // First check if given port is within the range of allowed ports
    93     if(!PortFinder.isAssignablePortNumber(quitPort)) {
    94         recordError("QuitPort provided is not within acceptable range: ("
    95                    + PortFinder.PORTS_RESERVED + " - " + PortFinder.MAX_PORT + "]" );
    96         quitPort = -1;
    97     }
    98    
    99     if(quitPort != -1) {
    100         try {
    101         new QuitListener(quitPort).start();
    102         } catch(Exception e) {
    103         Server2.this.recordError("Exception constructing the QuitListener thread.");
     92    if(quitPort != -1) {
     93        // First check if given port is within the range of allowed ports
     94        if(PortFinder.isAssignablePortNumber(quitPort)) {
     95        try {
     96            new QuitListener(quitPort).start();
     97        } catch(Exception e) {
     98            Server2.this.recordError("Exception constructing the QuitListener thread.");
     99        }
     100        }
     101        else {
     102        recordError("QuitPort provided is not within acceptable range: ("
     103                + PortFinder.PORTS_RESERVED + " - " + PortFinder.MAX_PORT + "]" );
     104        quitPort = -1;
    104105        }
    105106    }
Note: See TracChangeset for help on using the changeset viewer.