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 (IsConnected) {
    _response.Close();
    await _InternalOnDisconnect(reason, exception);
  }
}