📄 client.java
字号:
import java.net.*;
import java.io.*;
public class Client{
static Socket sammy;
public static void main(String[] args)throws Exception{
sammy=new Socket(InetAddress.getLocalHost(),20000);
BufferedReader in=new BufferedReader(new InputStreamReader(sammy.getInputStream()));
PrintWriter out=new PrintWriter(sammy.getOutputStream());
BufferedReader wt=new BufferedReader(new InputStreamReader(System.in));
System.out.println("input some code('end' to over)");
while(true){
String str=wt.readLine();
out.println(str);
out.flush();
if(str.equals("end")){
break;}
System.out.println(in.readLine());
}
System.out.println(in.readLine());
sammy.close();
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -