Skip to content

[QUIC] Finalize QUIC stream abort model #32075

@scalablecory

Description

@scalablecory

QUIC supports aborting the read or write side of a stream independently from the other side of the stream.

We should determine how to allow a user to do an "abortive dispose" such that all pending I/Os in both directions are aborted.

// TODO do we want this to be a synchronization mechanism to cancel a pending read
// If so, we need to complete the read here as well.
internal override void AbortRead(long errorCode)

// TODO do anything to stop writes?
using CancellationTokenRegistration registration = cancellationToken.Register(() =>
{
bool shouldComplete = false;
lock (_sync)
{
if (_shutdownState == ShutdownWriteState.None)
{
_shutdownState = ShutdownWriteState.Canceled;
shouldComplete = true;
}
}
if (shouldComplete)
{
_shutdownWriteResettableCompletionSource.CompleteException(new OperationCanceledException("Shutdown was canceled"));
}
});

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-System.Net.QuicenhancementProduct code improvement that does NOT require public API changes/additions

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions