generated from root/miduo_server
修改2
parent
fa56eefa18
commit
abc6f30c08
|
|
@ -383,22 +383,14 @@ public class ServerInfoController {
|
|||
* @return
|
||||
*/
|
||||
private boolean checkPort(List<String> strings, String port, String limitPort){
|
||||
// 1,第一行日志无用,所以删除
|
||||
strings.remove(0);
|
||||
ArrayList<String> list = new ArrayList<>();
|
||||
for (String string : strings) {
|
||||
// 2,用【 】分割
|
||||
String[] split = string.split(" ");
|
||||
for (String str1 : split) {
|
||||
if (str1.contains(limitPort)){
|
||||
// 3,用【:】分割
|
||||
String[] str2 = str1.split(":");
|
||||
// 4,取最后一位,是端口号
|
||||
String s = str2[str2.length - 1];
|
||||
// 1,用【:】分割
|
||||
String[] split = string.split(":");
|
||||
// 2,取最后一位,是端口号
|
||||
String s = split[split.length - 1];
|
||||
list.add(s);
|
||||
}
|
||||
}
|
||||
}
|
||||
return list.contains(port);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue