1 write to _state
Microsoft.AspNetCore.SignalR.Client.Core (1)
HubConnection.cs (1)
244_state = new ReconnectingConnectionState(_logger);
74 references to _state
Microsoft.AspNetCore.SignalR.Client.Core (74)
HubConnection.cs (74)
192public string? ConnectionId => _state.CurrentConnectionStateUnsynchronized?.Connection.ConnectionId; 197public HubConnectionState State => _state.OverallState; 275await _state.WaitConnectionLockAsync(token: cancellationToken).ConfigureAwait(false); 278if (!_state.TryChangeState(HubConnectionState.Disconnected, HubConnectionState.Connecting)) 285if (_state.StopCts.Token.IsCancellationRequested) 290using (CancellationTokenUtils.CreateLinkedToken(cancellationToken, _state.StopCts.Token, out var linkedToken)) 295_state.ChangeState(HubConnectionState.Connecting, HubConnectionState.Connected); 299if (_state.TryChangeState(HubConnectionState.Connecting, HubConnectionState.Disconnected)) 301_state.StopCts = new CancellationTokenSource(); 308_state.ReleaseConnectionLock(); 485_state.AssertInConnectionLock(); 486SafeAssert(_state.CurrentConnectionStateUnsynchronized == null, "We already have a connection!"); 540_state.CurrentConnectionStateUnsynchronized = startingConnectionState; 566_state.StopCts.Cancel(); 570await _state.WaitConnectionLockAsync(token: default).ConfigureAwait(false); 573var reconnectTask = _state.ReconnectTask; 581_state.ReleaseConnectionLock(); 583await _state.WaitConnectionLockAsync(token: default).ConfigureAwait(false); 599connectionState = _state.CurrentConnectionStateUnsynchronized; 630_state.StopCts = new CancellationTokenSource(); 656_state.ReleaseConnectionLock(); 706await _state.WaitConnectionLockAsync(token: default).ConfigureAwait(false); 709if (_state.CurrentConnectionStateUnsynchronized != null) 714await SendHubMessage(_state.CurrentConnectionStateUnsynchronized, new CancelInvocationMessage(irq.InvocationId), cancellationToken: default).ConfigureAwait(false); 727_state.ReleaseConnectionLock(); 761_state.ReleaseConnectionLock(); 832_state.AssertInConnectionLock(); 997await _state.WaitConnectionLockAsync(token: default).ConfigureAwait(false); 1001if (_state.IsConnectionActive()) 1017_state.ReleaseConnectionLock(); 1030var connectionStateTask = _state.WaitForActiveConnectionAsync(sendingMethodName, token); 1101_state.ReleaseConnectionLock(); 1166_state.AssertConnectionValid(); 1209_state.AssertConnectionValid(); 1265_state.ReleaseConnectionLock(); 1272var connectionState = await _state.WaitForActiveConnectionAsync(callerName, token: cancellationToken).ConfigureAwait(false); 1283_state.ReleaseConnectionLock(); 1596_state.AssertInConnectionLock(); 1719return _state.CurrentConnectionStateUnsynchronized!.RunTimerActions(); 1726_state.CurrentConnectionStateUnsynchronized!.OnServerTimeout(); 1732await _state.WaitConnectionLockAsync(token: default).ConfigureAwait(false); 1735SafeAssert(ReferenceEquals(_state.CurrentConnectionStateUnsynchronized, connectionState), 1737_state.CurrentConnectionStateUnsynchronized = null; 1757_state.ChangeState(HubConnectionState.Connected, HubConnectionState.Disconnected); 1762_state.ReconnectTask = ReconnectAsync(connectionState.CloseException); 1767_state.ReleaseConnectionLock(); 1773_state.AssertInConnectionLock(); 1774_state.StopCts = new CancellationTokenSource(); 1814_state.AssertInConnectionLock(); 1820_state.ChangeState(HubConnectionState.Connected, HubConnectionState.Disconnected); 1826_state.ChangeState(HubConnectionState.Connected, HubConnectionState.Reconnecting); 1845await Task.Delay(nextRetryDelay.Value, _state.StopCts.Token).ConfigureAwait(false); 1851await _state.WaitConnectionLockAsync(token: default).ConfigureAwait(false); 1854_state.ChangeState(HubConnectionState.Reconnecting, HubConnectionState.Disconnected); 1856CompleteClose(GetOperationCanceledException("Connection stopped during reconnect delay. Done reconnecting.", ex, _state.StopCts.Token)); 1860_state.ReleaseConnectionLock(); 1866await _state.WaitConnectionLockAsync(token: default).ConfigureAwait(false); 1869SafeAssert(ReferenceEquals(_state.CurrentConnectionStateUnsynchronized, null), 1872await StartAsyncCore(_state.StopCts.Token).ConfigureAwait(false); 1876_state.ChangeState(HubConnectionState.Reconnecting, HubConnectionState.Connected); 1887if (_state.StopCts.IsCancellationRequested) 1891_state.ChangeState(HubConnectionState.Reconnecting, HubConnectionState.Disconnected); 1893CompleteClose(GetOperationCanceledException("Connection stopped during reconnect attempt. Done reconnecting.", ex, _state.StopCts.Token)); 1901_state.ReleaseConnectionLock(); 1907await _state.WaitConnectionLockAsync(token: default).ConfigureAwait(false); 1910SafeAssert(ReferenceEquals(_state.CurrentConnectionStateUnsynchronized, null), 1916_state.ChangeState(HubConnectionState.Reconnecting, HubConnectionState.Disconnected); 1923_state.ReleaseConnectionLock(); 1950return new OperationCanceledException(message, innerException, _state.StopCts.Token); 2257_hubConnection._state.AssertInConnectionLock(); 2354if (!_hubConnection._state.TryAcquireConnectionLock()) 2364if (_hubConnection._state.CurrentConnectionStateUnsynchronized != null) 2366SafeAssert(ReferenceEquals(_hubConnection._state.CurrentConnectionStateUnsynchronized, this), 2378_hubConnection._state.ReleaseConnectionLock();