close method
Closes our side of the channel. Returns a Future that completes when the remote side has closed the channel.
Implementation
Future<void> close() async {
if (_done.isCompleted) return;
_locaStreamConsumer.cancel();
_sendEOFIfNeeded();
if (_remoteStream.isClosed) {
_sendCloseIfNeeded();
_done.complete();
return;
}
return _done.future;
}