import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.net.Socket;
import java.util.Scanner;


public class Client {

	public static void main(String[] args) {
		try {
			System.out.println("CLIENT");
			Socket socket = new Socket("10.75.30.98",2048);
			PrintWriter pw = new PrintWriter(socket.getOutputStream());
			BufferedReader br = new BufferedReader(new InputStreamReader(socket.getInputStream()));
			Scanner scanner = new Scanner(System.in);
			System.out.println("CONNECTED");
			while(true) {
				System.out.println("Waiting on input...");
				System.out.print(">>> ");
				String in = scanner.nextLine();
				pw.write(in + "\n");
				pw.flush();
				System.out.println("Waiting on response...");
				String out = br.readLine();
				System.out.println(out);
			}
		} catch (IOException e) {
			e.printStackTrace();
		}
	}

}
