public final class NetworkUtils extends Object
NetworkUtils is used as TCP server or port helper functions.| Modifier and Type | Field and Description |
|---|---|
static int |
RETRY_COUNT
Client connection retry count
|
static int |
TRY_PORT_COUNT
How many ports will be used to launch embed zookeeper server.
|
| Modifier and Type | Method and Description |
|---|---|
static int |
getValidServerPort(int iniatialPort)
Get valid TCP server port.
|
static boolean |
isServerAlive(InetAddress host,
int port)
Check whether a server is alive.
|
static boolean |
isServerAlive(String host,
int port)
Check whether a server is alive.
|
public static final int RETRY_COUNT
public static final int TRY_PORT_COUNT
public static boolean isServerAlive(String host, int port)
host - the server hostport - the server portpublic static boolean isServerAlive(InetAddress host, int port)
host - the server hostport - the server portpublic static int getValidServerPort(int iniatialPort)
Copyright © 2015. All Rights Reserved.