close method

Future<void> close()

Closes the session, asking the node to terminate the process.

Implementation

Future<void> close() async {
  _channel.sendControl(
    ChannelClose(channel: _channel.id, reason: 'client_closed'),
  );
  await _controlSub.cancel();
  if (!_exit.isCompleted) _exit.complete(-1);
  await _channel.close();
}