ClientWebSocket.CloseOutputAsync Method (WebSocketCloseStatus, String, CancellationToken)

.NET Framework (current version)

The .NET API Reference documentation has a new home. Visit the .NET API Browser on to see the new experience.

Close the output for the ClientWebSocket instance as an asynchronous operation.

Namespace:   System.Net.WebSockets
Assembly:  System (in System.dll)

public override Task CloseOutputAsync(
	WebSocketCloseStatus closeStatus,
	string statusDescription,
	CancellationToken cancellationToken


Type: System.Net.WebSockets.WebSocketCloseStatus

The WebSocket close status.

Type: System.String

A description of the close status.

Type: System.Threading.CancellationToken

A cancellation token used to propagate notification that this operation should be canceled.

Return Value

Type: System.Threading.Tasks.Task

Returns Task.

The task object representing the asynchronous operation.

This operation will not block. The returned Task object will complete after the output on the ClientWebSocket instance is closed.

.NET Framework
Available since 4.5
Return to top