public static void main(String[] args) throws Exception{
		String configuration_filename = new String("");
		String local_name = new String("");
		String send_info = new String("");
		listener = new ServerSocket(12344);
		Message message = new Message();
		//Scanner in =new Scanner(System.in);
		//configuration_filename = in.next();
		//local_name = in.next();
		MessagePasser MP = new MessagePasser(configuration_filename, local_name);

		
		
		MP.CreateThread();
		
		Socket socket = new Socket("128.237.174.156",12344);
		PrintWriter ot = new PrintWriter(socket.getOutputStream());
		
		InputStreamReader reader = new InputStreamReader(System.in);
		BufferedReader input = new BufferedReader(reader);
		send_info = input.readLine();
		
		
		
		while (!send_info.equals("exit")) {
			String[] command = send_info.split(" ");
			if (command.length != 2 || !(command[0].equals("send") || command[0].equals("read"))) {
				System.out.println("Enter the right command!");
				send_info = input.readLine();
				continue;
				}
			if (command[0].equals("read")) {
				MP.receive();
				send_info = input.readLine();
				continue;
			}
			if (command[0].equals("send")) {
				ot.println(send_info);
				ot.flush();
				send_info = input.readLine();
				continue;
			}
		}
		
		//System.out.println(configuration_filename);
		//System.out.println(local_name);
		socket.close();
		listener.close();
		System.out.println("Program exit normally");

		
		
	}