DisconnectWithException method

void DisconnectWithException(
  1. HangingRequestDisconnectReason reason,
  2. Exception? exception
)
Disconnects the request with the specified reason and exception. The reason. The exception.

Implementation

void DisconnectWithException(
    HangingRequestDisconnectReason reason, Exception? exception) {
  if (this.IsConnected!) {
    this._response.Close();
    this._InternalOnDisconnect(reason, exception);
  }
}