@Override
    public void run() {
        String message;
        try {
            User user = (User) ois.readObject();
            if (authentication(user)) {

                LOGGER.info(user.getNickname()+" connected");
                clientList.add(user);
                oos.writeObject(clientList);
            } else {
                userSocket.close();
                ois.close();
                oos.close();
                return;
            }
            
            BufferedWriter writer = new BufferedWriter(new OutputStreamWriter(userSocket.getOutputStream()));
            BufferedReader reader = new BufferedReader(new InputStreamReader(userSocket.getInputStream()));
            while(true){
                message = reader.readLine();
                for (User client : clientList) {
                    writer.write("\""+client.getNickname()+"\": "+message);
                    writer.flush();
                   
                }
            }
            
        } catch (ClassNotFoundException ex) {
            LOGGER.error(ex.getMessage(), ex);
        } catch (IOException ex) {
            //LOGGER.info();
            return;
//            if (user!=null)
//            clientList.remove(user);
            
        }

    }