62,612
社区成员
发帖
与我相关
我的任务
分享
public static void Body()throws UnknownHostException, IOException {
while(true){
Socket socket=new Socket("localhost",9900);
Scanner in=new Scanner(System.in);
OutputStream os=socket.getOutputStream();
System.out.println("1-Upload File 2-Check File 3-Download 4- ");
int choice=in.nextInt();
os.write(choice);
os.flush();
socket.shutdownOutput();
InputStream is=socket.getInputStream();
int read=is.read();
if(read==1){
ClientAnalyseHandling.sendFile();
}else if(read==2){
}
os.close();
socket.close();
}
}