public async ValueTask DisposeAsync() { if (_connection == null) { return; } await _writer.DisposeAsync().ConfigureAwait(false); _reader.Connection.Transport.Input.CancelPendingRead(); await _readingTask.ConfigureAwait(false); await _reader.DisposeAsync().ConfigureAwait(false); foreach (var operation in _operations) { _operations.TryRemove(operation.Key, out _); // Cancel all pending operations operation.Value.TrySetCanceled(); } await _connection.DisposeAsync().ConfigureAwait(false); }
public ValueTask DisposeAsync() { return(_protocol.DisposeAsync()); }