disconnect method

  1. @override
Future disconnect()
override

Implementation

@override
Future disconnect() async {
  if (channel == null) {
    throw Exception('Channel is already close');
  }
  for (final controller in subscriptions.values) {
    await controller.close();
  }
  subscriptions.clear();
  await channel!.sink.close(status.goingAway);
  channel = null;
}