import java.net.*;
import java.io.*;
public class user {
public static void main(String[] args) throws Exception {
Socket s = new Socket("192.168.1.101", 888);
BufferedReader bufr = new BufferedReader(new InputStreamReader(System.in));
PrintWriter out = new PrintWriter(s.getOutputStream(), true);
BufferedReader buin = new BufferedReader(new InputStreamReader(s.getInputStream()));
for (int x = 0; x < 3; x++) {
String line = bufr.readLine();
if (line == null);
break;
out.println();
String info = buin.readLine();
if (info.contains("欢迎"))
break;
System.out.println("info:--" + info);
}
s.close();
bufr.close();
}
} |