xsul.http_server.plain_impl
Class TcpPortRange

java.lang.Object
  extended byxsul.http_server.plain_impl.TcpPortRange

public class TcpPortRange
extends java.lang.Object

This class is based on code Cog (see license notice attached at the end of file).

Version:
$Revision: 1.1 $
Author:
Aleksander Slominski

Constructor Summary
TcpPortRange(java.lang.String portRangeStr)
           
 
Method Summary
 void free(int portNumber)
          Releases or frees the port number.
 int getFreePort(int lastPortNumber)
          Returns first available port >= lastPortNumber;
 void setUsed(int portNumber)
          Sets the port number as used.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TcpPortRange

public TcpPortRange(java.lang.String portRangeStr)
Method Detail

getFreePort

public int getFreePort(int lastPortNumber)
                throws java.io.IOException
Returns first available port >= lastPortNumber;

Parameters:
lastPortNumber - port number to start finding the next available port from. Set it to 0 if called initialy.
Returns:
the next available port number from the lastPortNumber.
Throws:
java.io.IOException

setUsed

public void setUsed(int portNumber)
Sets the port number as used.

Parameters:
portNumber - port number

free

public void free(int portNumber)
Releases or frees the port number. (Mark it as unused)

Parameters:
portNumber - port number


IU Extreme! Lab (http://www.extreme.indiana.edu)