62,615
社区成员
发帖
与我相关
我的任务
分享
Socket socket= Socket("127.0.0.1",8080);
socket.setKeepAlive(true);
public void run{
while(true){
if(socket.getKeepAlive){
System.out.println("Client connect to Server is OK");
}else{
socket=soket("127.0.0.1",8080);
}
try {
Thread.sleep(60000);
} catch (InterruptedException e) {
e.printStackTrace();
}
}
}