private void ListenReciveMesages()
        {
            while (true)
            {
                try
                {
                    string data = _responseHandler.GetResponse(_client);

                    OperationExecuteFactory operationExecuteFactory = new OperationExecuteFactory(_userClient.Name, _allChatDetails);

                    operationExecuteFactory.Execute(data);

                    Console.WriteLine($"Received from {_userClient.Name}: " + data);

                    if (data == "Close")
                    {
                        CloseSocket();
                        break;
                    }
                    //SendToAll(data);
                }
                catch (Exception e)
                {
                    CloseSocket();
                    break;
                }
            }
        }
        private void ListenReciveMesages()
        {
            while (true)
            {
                try
                {
                    string data = _containerInterfaces.ResponseHandler.GetResponse(_client);

                    OperationExecuteFactory operationExecuteFactory = new OperationExecuteFactory(_userClient, _allChatDetails, _containerInterfaces);

                    operationExecuteFactory.Execute(data);

                    _containerInterfaces.Logger.LogInformation($"Received from {_userClient.Name}: " + data);

                    if (data == "Close")
                    {
                        CloseSocket();
                        break;
                    }
                }
                catch (Exception e)
                {
                    CloseSocket();
                    break;
                }
            }
        }