java socket 阻塞问题
ServerSocketserverSocket=newServerSocket(80);while(true){System.out.println(">>>Waiti...
ServerSocket serverSocket = new ServerSocket(80);
while (true) {
System.out.println(">>>Waiting for connect.");
Socket socket = serverSocket.accept();
System.out.println("!");
ManagerServer server = new ManagerServer(socket);
server.console();
System.out.println("Get a connect, handle complete.<<<");
socket.close();
}
第二次循环到 Socket socket = serverSocket.accept();就不执行了,求解。 展开
while (true) {
System.out.println(">>>Waiting for connect.");
Socket socket = serverSocket.accept();
System.out.println("!");
ManagerServer server = new ManagerServer(socket);
server.console();
System.out.println("Get a connect, handle complete.<<<");
socket.close();
}
第二次循环到 Socket socket = serverSocket.accept();就不执行了,求解。 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询