Method CloseAsync
CloseAsync(WebSocketCloseStatus, string?, CancellationToken)
Closes the WebSocket connection asynchronously.
public abstract Task CloseAsync(WebSocketCloseStatus closeStatus, string? reason, CancellationToken cancellation)
Parameters
closeStatus
WebSocketCloseStatusThe status code for closing the WebSocket.
reason
stringThe reason for closing the WebSocket.
cancellation
CancellationTokenThe cancellation token.