@Override
    public void run(){
        String msg;
        try {
            DataInputStream inp = new DataInputStream(sock.getInputStream());
            while(true){
                msg = inp.readUTF();
                if(msg.equals("qwert345")){
//                    InstantMessenger.Frn.setVisible(true);
//                    InstantMessenger.chatPage.setVisible(false);
//                    sock.close();
//                    InstantMessenger.server = null;
//                    InstantMessenger.server = new Serv(6789, database);
//                    break;
                    InstantMessenger.exitApp();
                }
                InstantMessenger.chatPage.msgArea.append(frnd+": "+msg+"\n");
            }
        } catch (IOException ex) {
            //Logger.getLogger(msgRecv.class.getName()).log(Level.SEVERE, null, ex);
        }
    }