AuthenticatedStream.DisposeAsync Method

Definition

Asynchronously releases the unmanaged and managed resources used by the AuthenticatedStream.

C#
public override System.Threading.Tasks.ValueTask DisposeAsync();

Returns

A task that represents the asynchronous dispose operation.

Remarks

This method allows performing resource-intensive dispose operations without blocking the main thread.

This method also disposes the inner stream when LeaveInnerStreamOpen is false; otherwise, the inner stream is just flushed.

Calling DisposeAsync allows the resources used by the AuthenticatedStream to be reallocated for other purposes. For more information, see Cleaning Up Unmanaged Resources.

Applies to

Product Versions
.NET Core 3.0, Core 3.1, 5, 6, 7, 8, 9, 10
.NET Standard 2.1