ConnectionWrapper
Ecng.Net.ConnectionStateTracker
Wraps an IConnection instance to listen for its state changes.
継承元: Disposable
コンストラクター
ConnectionWrapper
public ConnectionWrapper(IConnection connection, Func<CancellationToken, ValueTask> stateChanged)
connectionWrapper = ConnectionWrapper(connection, stateChanged)
Initializes a new instance of the ConnectionWrapper class.
- connection
- The connection to wrap.
- stateChanged
- Callback invoked when the connection state changes.
プロパティ
State
public ConnectionStates State { get; private set; }
value = connectionWrapper.State
connectionWrapper.State = value
Gets the current connection state of the wrapped connection.
メソッド
DisposeManaged
protected override void DisposeManaged()
connectionWrapper.DisposeManaged()
Disposes the managed resources.
OnStateChanged
private ValueTask OnStateChanged(ConnectionStates newState, CancellationToken cancellationToken)
result = connectionWrapper.OnStateChanged(newState, cancellationToken)
Handles the state change event from the wrapped connection.