class Client {
public static void main(String[] args) throws IOException {
String data;
Socket client = null;
BufferedReader inputs = null;
BufferedReader key = null;
PrintStream outputs = null;
client = new Socket("localhost",6000);
inputs = new BufferedReader(new InputStreamReader(client.getInputStream()));
outputs = new PrintStream(client.getOutputStream());
key = new BufferedReader(new InputStreamReader(System.in));
while(true) {
System.out.println("----------------------------");
System.out.print("请出拳:石头/剪刀/布 ");
data = key.readLine();
outputs.println(data);
System.out.println("ECHO: " + inputs.readLine());
}
}
}
楼层 3 14 25 53 65 78 81 103 120 143
|