Changeset 19432

Show
Ignore:
Timestamp:
13.05.2009 14:29:21 (10 years ago)
Author:
ak19
Message:

Changing somethings about previous commit: isPortAvailable takes a parameter called verbose instead of one called silent.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • gli/trunk/src/org/greenstone/gatherer/util/PortFinder.java

    r19429 r19432  
    4747     *  @return the number of an available port.     
    4848     */ 
    49     public int findPortInRange(boolean silent) throws Exception {    
     49    public int findPortInRange(boolean verbose) throws Exception {   
    5050    try { 
    5151        boolean foundFreePort = false; 
    5252        for(int i = 0; i < PORT_BLOCK_SIZE; i++) { 
    5353         
    54         if(isPortAvailable(nextFreePort, silent)) { 
     54        if(isPortAvailable(nextFreePort, verbose)) { 
    5555            foundFreePort = true; 
    5656            break; 
     
    108108 
    109109    /** @return true if the portnum is available for use */ 
    110     public static boolean isPortAvailable(int portnum, boolean silent) { 
     110    public static boolean isPortAvailable(int portnum, boolean verbose) { 
    111111    ServerSocket tmpSocket = null; 
    112112    try { 
    113113        tmpSocket = new ServerSocket(portnum); 
    114114        tmpSocket.close(); 
    115         if(!silent) { 
     115        if(verbose) { 
    116116        System.err.println("Port " + portnum + " not yet in use."); 
    117117        } 
     
    122122        // socket to a local address and port. Typically, the port is  
    123123        // in use, or the requested local address could not be assigned." 
    124         if(!silent) { 
     124        if(verbose) { 
    125125        System.err.println("Port " + portnum + " already in use or can't be assigned."); 
    126126        }