java检测端口号是否被占用的工具类: package com.frank.util; import java.io.IOException; import java.net.InetAddress; import java.net.Socket; import java.net.UnknownHostException; public class NetUtil { /*** * true:already in using false:not using * @param port
1.java代码 /** 获取客户端IP */ public static final String getClientIp(HttpServletRequest request) { String ip = request.getHeader("X-Forwarded-For"); if (StringUtils.isBlank(ip) || "unknown".equalsIgnoreCase(ip)|| "127.0.0.1".equals