close method

  1. @override
Future<void> close()
override

Closes the stream.

  • Any buffered data for writing will be flushed.
  • Future reads will fail.
  • Any in-progress reads/writes will be interrupted.

Close may be asynchronous and does not guarantee receipt of the data.

Close closes the stream for both reading and writing. Close is equivalent to calling closeRead and closeWrite. Importantly, Close will not wait for any form of acknowledgment. If acknowledgment is required, the caller must call closeWrite, then wait on the stream for a response (or an EOF), then call close() to free the stream object.

When done with a stream, the user must call either close() or reset() to discard the stream, even after calling closeRead and/or closeWrite.

Implementation

@override
Future<void> close() async {
  _logger.fine('[UDXP2PStreamAdapter ${id()}] close() called.');
  return _close();
}