public void run() //listening
    {

        Server.print("running function: run()");
        boolean isOK = true;
        while (isOK)
        {
            try
            {
                String in = input.readUTF();

                if (in.equals("#move"))//new move
                {
                    int bX = input.readInt();
                    int bY = input.readInt();
                    int eX = input.readInt();
                    int eY = input.readInt();

                    table.sendMoveToOther(this, bX, bY, eX, eY);
                }
                else if (in.equals("#message"))//new message
                {
                    String str = input.readUTF();

                    table.sendMessageToAll(nick + ": " + str);
                }
                else if(in.equals("#undoAsk") || in.equals("#undoAnswerNegative") )
                {
                    table.sendToAll(this, in);
                }
                else if(in.equals("#undoAnswerPositive") )
                {
                    table.sendUndoToAll(this, in);
                }
            }
            catch (IOException ex)
            {
                Logger.getLogger(Server.class.getName()).log(Level.SEVERE, null, ex);
                isOK = false;
                try
                {
                    table.sendErrorConnectionToOther(this);
                }
                catch (IOException ex1)
                {
                    Logger.getLogger(SClient.class.getName()).log(Level.SEVERE, null, ex1);
                }
            }

        }
    }