ClientWebSocket.CloseOutputAsync(WebSocketCloseStatus, String, CancellationToken) 方法
定义
关闭作为异步操作的 ClientWebSocket 实例的输出。Close the output for the ClientWebSocket instance as an asynchronous operation.
public:
override System::Threading::Tasks::Task ^ CloseOutputAsync(System::Net::WebSockets::WebSocketCloseStatus closeStatus, System::String ^ statusDescription, System::Threading::CancellationToken cancellationToken);
public override System.Threading.Tasks.Task CloseOutputAsync (System.Net.WebSockets.WebSocketCloseStatus closeStatus, string? statusDescription, System.Threading.CancellationToken cancellationToken);
public override System.Threading.Tasks.Task CloseOutputAsync (System.Net.WebSockets.WebSocketCloseStatus closeStatus, string statusDescription, System.Threading.CancellationToken cancellationToken);
override this.CloseOutputAsync : System.Net.WebSockets.WebSocketCloseStatus * string * System.Threading.CancellationToken -> System.Threading.Tasks.Task
Public Overrides Function CloseOutputAsync (closeStatus As WebSocketCloseStatus, statusDescription As String, cancellationToken As CancellationToken) As Task
参数
- closeStatus
- WebSocketCloseStatus
WebSocket 关闭状态。The WebSocket close status.
- statusDescription
- String
关闭状态的说明。A description of the close status.
- cancellationToken
- CancellationToken
一个取消标记,用于传播应取消此操作的通知。A cancellation token used to propagate notification that this operation should be canceled.
返回
表示异步操作的任务对象。The task object representing the asynchronous operation.
注解
此操作不会阻止。This operation will not block. 返回的 Task 对象将在实例上的输出关闭之后完成 ClientWebSocket 。The returned Task object will complete after the output on the ClientWebSocket instance is closed.