public boolean listenSocket(String username, String password) {
        try {
            socket = new Socket("localhost", 4444);
            System.out.println("Connected to server localhost on port 4444");
            out = new DataOutputStream(socket.getOutputStream());
            System.out.println("DataOutputStream initialised");
            in = new DataInputStream(socket.getInputStream());
            System.out.println("BufferedReader initialised");
            out.writeUTF(username + ":" + password);
            System.out.println("login data sent "+username + ":" + password);
            out.flush();
            
            return true;
        } catch (UnknownHostException e) {
            System.out.println("Unknown host");
            System.exit(1);
            return false;
        } catch (IOException e) {
            System.out.println("No I/O");
            System.exit(1);
            return false;
        }
    }