62,614
社区成员
发帖
与我相关
我的任务
分享
import java.io.IOException;
import java.net.ServerSocket;
public class Main {
public static void main(String[] args) {
if (open()) {
try {
Thread.sleep(3000);
} catch (InterruptedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
while (true) {
System.out.println("java------------");
}
}
}
private static boolean open() {
try {
ServerSocket ss = new ServerSocket(8011);
return true;
} catch (IOException e) {
return false;
}
}
}
netstat -aon|findstr "8011"
while(true){}
循环,