Commit 9c3d1a2b authored by 李丛阳's avatar 李丛阳

office

parent d6792989
...@@ -139,19 +139,18 @@ public class BCodeLxcServiceImpl implements BCodeLxcService { ...@@ -139,19 +139,18 @@ public class BCodeLxcServiceImpl implements BCodeLxcService {
private synchronized Integer getIdleWithPorts(List<String> ports, Integer port, Integer maxPort) { private synchronized Integer getIdleWithPorts(List<String> ports, Integer port, Integer maxPort) {
int choosePort = 0; int choosePort = 0;
/*端口占用满了*/ /*端口占用满了*/
if(ports.size() -1 == maxPort - port) if(ports.size() -1 - (maxPort - port) == 0)
return choosePort; return choosePort;
boolean flag = false;
for(int i = port ; i < maxPort - port ; i++){ for(int i = port ; i < maxPort - port ; i++){
flag = false; boolean flag = false;
for (int j = 0 ; j < ports.size() ; j++){ for (int j = 0 ; j < ports.size() ; j++){
if(port == Integer.parseInt(ports.get(j))) { if(i - Integer.parseInt(ports.get(j)) == 0) {
flag = true; flag = true;
break; break;
} }
} }
if (flag){ if (!flag){
choosePort = port; choosePort = i;
break; break;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment