1 write to _state
Microsoft.AspNetCore.SignalR.Client.Core (1)
74 references to _state
Microsoft.AspNetCore.SignalR.Client.Core (74)
HubConnection.cs (74)
186public string? ConnectionId => _state.CurrentConnectionStateUnsynchronized?.Connection.ConnectionId;
191public HubConnectionState State => _state.OverallState;
269await _state.WaitConnectionLockAsync(token: cancellationToken).ConfigureAwait(false);
272if (!_state.TryChangeState(HubConnectionState.Disconnected, HubConnectionState.Connecting))
279if (_state.StopCts.Token.IsCancellationRequested)
284using (CancellationTokenUtils.CreateLinkedToken(cancellationToken, _state.StopCts.Token, out var linkedToken))
289_state.ChangeState(HubConnectionState.Connecting, HubConnectionState.Connected);
293if (_state.TryChangeState(HubConnectionState.Connecting, HubConnectionState.Disconnected))
295_state.StopCts = new CancellationTokenSource();
302_state.ReleaseConnectionLock();
479_state.AssertInConnectionLock();
480SafeAssert(_state.CurrentConnectionStateUnsynchronized == null, "We already have a connection!");
534_state.CurrentConnectionStateUnsynchronized = startingConnectionState;
560_state.StopCts.Cancel();
564await _state.WaitConnectionLockAsync(token: default).ConfigureAwait(false);
567var reconnectTask = _state.ReconnectTask;
575_state.ReleaseConnectionLock();
577await _state.WaitConnectionLockAsync(token: default).ConfigureAwait(false);
593connectionState = _state.CurrentConnectionStateUnsynchronized;
624_state.StopCts = new CancellationTokenSource();
650_state.ReleaseConnectionLock();
700await _state.WaitConnectionLockAsync(token: default).ConfigureAwait(false);
703if (_state.CurrentConnectionStateUnsynchronized != null)
708await SendHubMessage(_state.CurrentConnectionStateUnsynchronized, new CancelInvocationMessage(irq.InvocationId), cancellationToken: default).ConfigureAwait(false);
721_state.ReleaseConnectionLock();
755_state.ReleaseConnectionLock();
826_state.AssertInConnectionLock();
991await _state.WaitConnectionLockAsync(token: default).ConfigureAwait(false);
995if (_state.IsConnectionActive())
1011_state.ReleaseConnectionLock();
1024var connectionStateTask = _state.WaitForActiveConnectionAsync(sendingMethodName, token);
1095_state.ReleaseConnectionLock();
1160_state.AssertConnectionValid();
1203_state.AssertConnectionValid();
1259_state.ReleaseConnectionLock();
1266var connectionState = await _state.WaitForActiveConnectionAsync(callerName, token: cancellationToken).ConfigureAwait(false);
1277_state.ReleaseConnectionLock();
1590_state.AssertInConnectionLock();
1713return _state.CurrentConnectionStateUnsynchronized!.RunTimerActions();
1720_state.CurrentConnectionStateUnsynchronized!.OnServerTimeout();
1726await _state.WaitConnectionLockAsync(token: default).ConfigureAwait(false);
1729SafeAssert(ReferenceEquals(_state.CurrentConnectionStateUnsynchronized, connectionState),
1731_state.CurrentConnectionStateUnsynchronized = null;
1751_state.ChangeState(HubConnectionState.Connected, HubConnectionState.Disconnected);
1756_state.ReconnectTask = ReconnectAsync(connectionState.CloseException);
1761_state.ReleaseConnectionLock();
1767_state.AssertInConnectionLock();
1768_state.StopCts = new CancellationTokenSource();
1808_state.AssertInConnectionLock();
1814_state.ChangeState(HubConnectionState.Connected, HubConnectionState.Disconnected);
1820_state.ChangeState(HubConnectionState.Connected, HubConnectionState.Reconnecting);
1839await Task.Delay(nextRetryDelay.Value, _state.StopCts.Token).ConfigureAwait(false);
1845await _state.WaitConnectionLockAsync(token: default).ConfigureAwait(false);
1848_state.ChangeState(HubConnectionState.Reconnecting, HubConnectionState.Disconnected);
1850CompleteClose(GetOperationCanceledException("Connection stopped during reconnect delay. Done reconnecting.", ex, _state.StopCts.Token));
1854_state.ReleaseConnectionLock();
1860await _state.WaitConnectionLockAsync(token: default).ConfigureAwait(false);
1863SafeAssert(ReferenceEquals(_state.CurrentConnectionStateUnsynchronized, null),
1866await StartAsyncCore(_state.StopCts.Token).ConfigureAwait(false);
1870_state.ChangeState(HubConnectionState.Reconnecting, HubConnectionState.Connected);
1881if (_state.StopCts.IsCancellationRequested)
1885_state.ChangeState(HubConnectionState.Reconnecting, HubConnectionState.Disconnected);
1887CompleteClose(GetOperationCanceledException("Connection stopped during reconnect attempt. Done reconnecting.", ex, _state.StopCts.Token));
1895_state.ReleaseConnectionLock();
1901await _state.WaitConnectionLockAsync(token: default).ConfigureAwait(false);
1904SafeAssert(ReferenceEquals(_state.CurrentConnectionStateUnsynchronized, null),
1910_state.ChangeState(HubConnectionState.Reconnecting, HubConnectionState.Disconnected);
1917_state.ReleaseConnectionLock();
1944return new OperationCanceledException(message, innerException, _state.StopCts.Token);
2251_hubConnection._state.AssertInConnectionLock();
2348if (!_hubConnection._state.TryAcquireConnectionLock())
2358if (_hubConnection._state.CurrentConnectionStateUnsynchronized != null)
2360SafeAssert(ReferenceEquals(_hubConnection._state.CurrentConnectionStateUnsynchronized, this),
2372_hubConnection._state.ReleaseConnectionLock();