ml.shifu.guagua.util
类 NetworkUtils

java.lang.Object
  继承者 ml.shifu.guagua.util.NetworkUtils

public final class NetworkUtils
extends Object

NetworkUtils is used as TCP server or port helper functions.


字段摘要
static int RETRY_COUNT
          Client connection retry count
static int TRY_PORT_COUNT
          How many ports will be used to launch embed zookeeper server.
 
方法摘要
static int getValidServerPort(int iniatialPort)
          Get valid TCP server port.
static boolean isServerAlive(InetAddress host, int port)
          Check whether a server is alive.
 
从类 java.lang.Object 继承的方法
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

字段详细信息

RETRY_COUNT

public static final int RETRY_COUNT
Client connection retry count

另请参见:
常量字段值

TRY_PORT_COUNT

public static final int TRY_PORT_COUNT
How many ports will be used to launch embed zookeeper server.

另请参见:
常量字段值
方法详细信息

isServerAlive

public static boolean isServerAlive(InetAddress host,
                                    int port)
Check whether a server is alive.

参数:
host - the server host
port - the server port
返回:
true if a server is alive, false if a server is not alive.

getValidServerPort

public static int getValidServerPort(int iniatialPort)
Get valid TCP server port.

返回:
valid TCP server port


Copyright © 2015. All Rights Reserved.