예제 #1
0
        public ConnectedClient(Host host)
        {
            handlers                = new ConcurrentDictionary <Guid, ConnectingHandler>();
            ID                      = Guid.NewGuid();
            ReconnectManager        = new ReconnectManager();
            incompleteTasksHandlers = new List <Task>();

            this.host = host;
        }
예제 #2
0
 public void Release()
 {
     NetworkManager.RemoveListenEvent <RoleReconnectRes>(new NetCallBackMethod <RoleReconnectRes>(this.OnVerifyReconnectDataServerRes));
     NetworkManager.Instance.RegistReconnectHandler(null);
     this.hasInit                    = false;
     this.enableReconnect            = true;
     this.isProcessingReconnect      = false;
     this.isReconnectingDataServer   = false;
     this.dataServerReconnectHandler = DataServerCityReconnectHandler.Instance;
     this.reconnectDataServerCount   = 0;
     this.isSendingDataServerVerify  = false;
     this.currentReconnectIEEndPoint = null;
     this.waitingReconnectList.Clear();
     this.waitConnectUI = null;
     TimerHeap.DelTimer(this.dataServerWaitTimer);
     TimerHeap.DelTimer(this.chatServerWaitTimer);
     ReconnectManager.instance = null;
 }
예제 #3
0
        public DeveloperToolsPopupViewModel(AppWindow appWindow,
                                            UserAuth userAuth,
                                            IPopupWindows popups,
                                            IModals modals,
                                            INotificationSender notificationSender,
                                            ConnectionStatusViewModel connectionStatusViewModel,
                                            IAppSettings appSettings,
                                            ReconnectManager reconnectManager)
            : base(appWindow)
        {
            _userAuth                  = userAuth;
            _popups                    = popups;
            _modals                    = modals;
            _notificationSender        = notificationSender;
            _connectionStatusViewModel = connectionStatusViewModel;
            _appSettings               = appSettings;
            _reconnectManager          = reconnectManager;

            InitializeCommands();
        }
예제 #4
0
            public void InitializationOnServer(ReconnectManager reconnectManager)
            {
                Initialization();

                this.reconnectManager = reconnectManager;
            }
예제 #5
0
 public void InitializationOnServer(Guid clientID, Guid handlerID, string handlerName, ReconnectManager reconnectManager)
 {
     Initialization(clientID, handlerID, handlerName, reconnectManager);
 }
예제 #6
0
        void Initialization(Guid clientID, Guid handlerID, string handlerName = null, ReconnectManager reconnectManager = null)
        {
            if (initialized)
            {
                throw new ArgumentException("Объект подключения уже был инициализирован. Повторная инициализация не допускается.");
            }

            if (IsServerSide)
            {
                if (string.IsNullOrWhiteSpace(handlerName))
                {
                    throw new ArgumentException(nameof(handlerName));
                }

                if (reconnectManager == null)
                {
                    throw new ArgumentNullException(nameof(reconnectManager));
                }

                connectionGuard.InitializationOnServer(reconnectManager);
            }
            else
            {
                connectionGuard.InitializationOnClient();
            }

            if (clientID == Guid.Empty)
            {
                throw new ArgumentException(nameof(clientID));
            }

            if (handlerID == Guid.Empty)
            {
                throw new ArgumentException(nameof(handlerID));
            }

            initialized.Value = true;
            HandlerID         = handlerID;

            this.clientID    = clientID;
            this.handlerName = handlerName;
        }