public void writeMessage(String message) {
        try {
            out = new DataOutputStream(client.getOutputStream());
            out.writeUTF(message);
            out.flush();
            System.out.println("OUTGOING: " + message);
        } catch (IOException ex) {
            Logger.getLogger(ServerThread.class.getName()).log(Level.SEVERE, null, ex);
        }
    }