private boolean loop(){
        try {
            Thread.sleep(1000);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        if(socket.isConnected()){
            return true;
        }else{
            return false;
        }
    }