{ Socket s = new Socket("xxx.xx.xx.xx",10004);
BufferedReader bufr = new BufferedReader(new InputStreamReader(System.in));
PrintWriter out = new PrintWriter(s.getOutputStream(),true);
BufferedReader bufIn = new BufferedReader(new InputStreamReader(s.getInputStream()));
String line = null;
while((line=bufr.readLine())!=null){
if("over".equals(line))
break;
out.println(line);
String upperStr = bufIn.readLine();
System.out.println(upperStr);
}
s.close();}
out.println(line);也是如此 意思是 1. 输入的字符串会出现在屏幕上 2. 内容会同时发送到服务器套接字?多谢你们。