@Override
        public void run() {
            try {
                boolean goFurther = true; /*аварийный выход*/
                /** первым делом получаю имя нового "клиента" */
                try {
                    goFurther = readClientName();
                } catch (IOException e) {
                    System.out.println("Error reading name from client...");
                    Log.write("Error reading name from client...");
                    Log.write(e.getMessage());
                    e.printStackTrace();
                }
                if (goFurther) {
                    String time = getTimeWithoutMillis(LocalTime.now());
                    String invitation = time + " " + name + " has joined";
                    printHistory();
                    addToHistory(invitation);
                    resendMessage(invitation);

                    /** читаю из входящего потока сообщения */
                    while (true) {
                        String received = null;
                        try {
                            received = in.readLine();
                            time = getTimeWithoutMillis(LocalTime.now());
                        } catch (IOException e) {
                            System.out.println("Error reading message from client...");
                            Log.write("Error reading message from client...");
                            Log.write(e.getMessage());
                            e.printStackTrace();
                        }
                        if (received == null) {
                            Log.write("received message from client is null");
                            break;
                        }

                        if (!received.trim().equals(AppConstants.EXIT)) {
                            String str = time + " " + name + ": " + received;
                            resendMessage(str);
                            addToHistory(str);
                        } else {
                            received = time + " " + name + " exit from chat";
                            addToHistory(received);
                            resendMessage(received);
                            out.println(AppConstants.EXIT);
                            Log.write(received);
                            break;
                        }
                    }
                }
            } finally {
                try {
                    closeConnection();
                    if (name != null) {
                        if (clients.containsKey(name)) {
                            clients.remove(name);
                            notifyAllClients();
                        }
                    }
                } catch (IOException e) {
                    System.out.println("Error closing socket on server side");
                    Log.write("Error closing socket on server side");
                    Log.write(e.getMessage());
                    e.printStackTrace();
                }
            }
        }