public ConnectedClient(Host host) { handlers = new ConcurrentDictionary <Guid, ConnectingHandler>(); ID = Guid.NewGuid(); ReconnectManager = new ReconnectManager(); incompleteTasksHandlers = new List <Task>(); this.host = host; }
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; }
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(); }
public void InitializationOnServer(ReconnectManager reconnectManager) { Initialization(); this.reconnectManager = reconnectManager; }
public void InitializationOnServer(Guid clientID, Guid handlerID, string handlerName, ReconnectManager reconnectManager) { Initialization(clientID, handlerID, handlerName, reconnectManager); }
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; }