net.sf.colossus.webserver
Class PortBookKeeper
java.lang.Object
net.sf.colossus.webserver.PortBookKeeper
public class PortBookKeeper
- extends java.lang.Object
This class keeps track of which ports are currently occupied
by ongoing games and which are free for new games.
- Author:
- Clemens Katzer
Constructor Summary |
PortBookKeeper(int portRangeFrom,
int availablePorts)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
LOGGER
private static final java.util.logging.Logger LOGGER
portRangeFrom
private final int portRangeFrom
availablePorts
private final int availablePorts
portUsed
private final boolean[] portUsed
PortBookKeeper
public PortBookKeeper(int portRangeFrom,
int availablePorts)
getFreePort
public int getFreePort()
testThatPortReallyFree
private boolean testThatPortReallyFree(int port)
releasePort
public void releasePort(int port)