public static void main(String[] args) {
        try {
            if (args.length != 2) {
                System.out.println("useage: java -jar TouchToggle.jar server_ip_address server_port");
                System.exit(0);
            }
            Socket sock = new Socket(args[0], Integer.parseInt(args[1]));

            DataInputStream in = new DataInputStream(sock.getInputStream());

            String s = in.readUTF();
            boolean currentState = false;

            if (s.compareTo("touch events currently off\n") == 0) {
                currentState = false;
            } else if (s.compareTo("touch events currently on\n") == 0) {
                currentState = true;
            } else {
                System.err.println("incoming message: " + s);
            }

            DataOutputStream os = new DataOutputStream(sock.getOutputStream());
            if (os != null) {
                if (!currentState) {
                    os.writeUTF("turn on touch events\n");
                    System.out.println("on");
                } else {
                    os.writeUTF("turn off touch events\n");
                    System.out.println("off");
                }
            }
            sock.close();

        } catch (UnknownHostException e) {
            System.err.println("Unknown host: " + args[0]);
        } catch (IOException e) {
            System.err.println(e.getMessage());
        }
    }