close method

Future<void> close()

Implementation

Future<void> close() async {
  if (_state == _MessagingStreamState.terminal) {
    await _inputDone;
    return;
  }
  _input.close();
  try {
    await _inputDone;
  } finally {
    await _output.cancel();
    _finish();
  }
}