DisconnectWithReason method

Future<void> DisconnectWithReason(
  1. HangingRequestDisconnectReason reason,
  2. Exception? exception
)
Disconnects the request with the specified reason and exception. The reason. The exception.

Implementation

Future<void> DisconnectWithReason(
    HangingRequestDisconnectReason reason, Exception? exception) async {
  if (this.IsConnected) {
    this._response.Close();
    await this._InternalOnDisconnect(reason, exception);
  }
}