类 HostInfo
- java.lang.Object
-
- network.nerve.core.rpc.info.HostInfo
-
public class HostInfo extends Object
获取本地IP地址,兼容Windows、Linux Get the local IP address, compatible with Windows, Linux- 作者:
- tangyi
-
-
构造器概要
构造器 构造器 说明 HostInfo()
-
方法概要
所有方法 静态方法 具体方法 修饰符和类型 方法 说明 static StringgetLocalIP()获取本地IP地址 Get local IP addressstatic intrandomPort()在10000-20000中随机生成端口号,如果已经被使用则重新生成 Randomly get the port number, range from 10,000 to 20,000 Re-random if the port already exists
-
-
-
方法详细资料
-
getLocalIP
public static String getLocalIP()
获取本地IP地址 Get local IP address- 返回:
- String
-
randomPort
public static int randomPort()
在10000-20000中随机生成端口号,如果已经被使用则重新生成 Randomly get the port number, range from 10,000 to 20,000 Re-random if the port already exists- 返回:
- Port
-
-