예제 #1
0
        private async void OnHubConnectionChanged()
        {
            if (!_hubConnection.IsConnected)
            {
                await Task.Delay(_hubConfiguration.ReconnectInMilliseconds);

                await _hubConnection.ConnectAsync();
            }
        }
예제 #2
0
        public Task StartAsync()
        {
            if (_hubConnection.IsConnected)
            {
                return(Task.CompletedTask);
            }

            foreach (var observer in _hubObservers)
            {
                _hubObservable.Subscribe(observer);
            }

            _hubReconnector.StartObserveForReconnection(_hubConnection);

            return(_hubConnection.ConnectAsync());
        }