public static String readLine(Socket socket){
        String line = new String();
        int c;

        try {
            while((c = socket.getInputStream().read()) != '\n'){
                line += (char) c;
            }
        } catch (IOException e) {
            System.err.println("Error reading line from stream");
            System.exit(-14);
        }

        // We may have a trailing return
        line = line.trim();

        //System.out.println("Read Line " + line);
        return line;
    }