类 HostInfo


  • public class HostInfo
    extends Object
    获取本地IP地址,兼容Windows、Linux Get the local IP address, compatible with Windows, Linux
    作者:
    tangyi
    • 构造器详细资料

      • HostInfo

        public HostInfo()
    • 方法详细资料

      • 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