|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.globus.net.PortRange
This class manages the port ranges. It keeps track of which ports are used and which ones are open.
| Field Summary | |
protected static byte |
UNUSED
|
protected static byte |
USED
|
| Constructor Summary | |
protected |
PortRange()
|
| Method Summary | |
void |
free(int portNumber)
Releases or frees the port number. |
int |
getFreePort(int lastPortNumber)
Returns first available port. |
static PortRange |
getInstance()
Returns PortRange instance for TCP listening sockets. |
static PortRange |
getTcpInstance()
Returns PortRange instance for TCP listening sockets. |
static PortRange |
getTcpSourceInstance()
Returns PortRange instance for TCP source sockets. |
static PortRange |
getUdpSourceInstance()
Returns PortRange instance for UDP source sockets. |
boolean |
isEnabled()
Checks if the port range is set. |
void |
setUsed(int portNumber)
Sets the port number as used. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
protected static final byte UNUSED
protected static final byte USED
| Constructor Detail |
protected PortRange()
| Method Detail |
public static PortRange getInstance()
getTcpInstance()public static PortRange getTcpInstance()
public static PortRange getTcpSourceInstance()
public static PortRange getUdpSourceInstance()
public boolean isEnabled()
public int getFreePort(int lastPortNumber)
throws IOException
lastPortNumber - port number to start finding the next
available port from. Set it to 0 if
called initialy.
IOException - if there is no more free ports available or
if the lastPortNumber is incorrect.public void setUsed(int portNumber)
portNumber - port numberpublic void free(int portNumber)
portNumber - port number
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||