WebSocket.CloseOutputAsync Metodo

Definizione

Avvia o completa l'handshake di chiusura definito nella specifica del protocollo WebSocket, sezione 7.

public:
 abstract System::Threading::Tasks::Task ^ CloseOutputAsync(System::Net::WebSockets::WebSocketCloseStatus closeStatus, System::String ^ statusDescription, System::Threading::CancellationToken cancellationToken);
public abstract System.Threading.Tasks.Task CloseOutputAsync(System.Net.WebSockets.WebSocketCloseStatus closeStatus, string? statusDescription, System.Threading.CancellationToken cancellationToken);
public abstract System.Threading.Tasks.Task CloseOutputAsync(System.Net.WebSockets.WebSocketCloseStatus closeStatus, string statusDescription, System.Threading.CancellationToken cancellationToken);
abstract member CloseOutputAsync : System.Net.WebSockets.WebSocketCloseStatus * string * System.Threading.CancellationToken -> System.Threading.Tasks.Task
Public MustOverride Function CloseOutputAsync (closeStatus As WebSocketCloseStatus, statusDescription As String, cancellationToken As CancellationToken) As Task

Parametri

closeStatus
WebSocketCloseStatus

Indica il motivo della chiusura della connessione WebSocket.

statusDescription
String

Consente alle applicazioni di specificare una spiegazione leggibile del motivo per cui la connessione viene chiusa.

cancellationToken
CancellationToken

Token che può essere usato per propagare la notifica che le operazioni devono essere annullate.

Valori restituiti

Oggetto attività che rappresenta l'operazione asincrona.

Eccezioni

Il token di annullamento è stato annullato. Questa eccezione viene archiviata nell'attività restituita.

Commenti

Questa operazione non verrà bloccata. L'oggetto restituito Task verrà completato dopo la chiusura dell'output in WebSocket.

Si applica a