|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.sf.jabb.util.net.SocketUtility
public class SocketUtility
Utility for Socket related functions.
| Constructor Summary | |
|---|---|
SocketUtility()
|
|
| Method Summary | |
|---|---|
static int |
getFreeServerPort()
Get a free server port that can be used. |
static int |
getFreeServerPort(boolean tryOthers,
int... ports)
Get a free server port that can be used. |
static int |
getFreeServerPort(int... ports)
Get a free server port that can be used. |
static int |
getFreeServerPort(int port)
Get a free server port that can be used. |
static boolean |
isServerPortFree(int port)
Check whether the specified server socket port is free or not. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public SocketUtility()
| Method Detail |
|---|
public static boolean isServerPortFree(int port)
port - the port number to be checked
public static int getFreeServerPort(int port)
port - preferred port number, or zero if no preference.
public static int getFreeServerPort()
public static int getFreeServerPort(boolean tryOthers,
int... ports)
tryOthers - If all preferred ports are occupied, try other free ports or not.ports - preferred port numbers
public static int getFreeServerPort(int... ports)
ports - preferred port numbers
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||