ClientWebSocket::CloseAsync Method (WebSocketCloseStatus, String^, CancellationToken)
.NET Framework (current version)
Close the ClientWebSocket instance as an asynchronous operation.
Assembly: System (in System.dll)
public: virtual Task^ CloseAsync( WebSocketCloseStatus closeStatus, String^ statusDescription, CancellationToken cancellationToken ) override
Parameters
- closeStatus
-
Type:
System.Net.WebSockets::WebSocketCloseStatus
The WebSocket close status.
- statusDescription
-
Type:
System::String^
A description of the close status.
- cancellationToken
-
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 ClientWebSocket instance is closed.
.NET Framework
Available since 4.5
Available since 4.5
Show: