private async void OnHubConnectionChanged() { if (!_hubConnection.IsConnected) { await Task.Delay(_hubConfiguration.ReconnectInMilliseconds); await _hubConnection.ConnectAsync(); } }
public Task StartAsync() { if (_hubConnection.IsConnected) { return(Task.CompletedTask); } foreach (var observer in _hubObservers) { _hubObservable.Subscribe(observer); } _hubReconnector.StartObserveForReconnection(_hubConnection); return(_hubConnection.ConnectAsync()); }