closeWrite method

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

Closes the stream for writing but leaves it open for reading

Implementation

@override
Future<void> closeWrite() async {
  if (_isClosed) return;
  try {
    await _underlyingMuxedStream.closeWrite();
  } on ResetException {
    // If closeWrite causes a reset, treat it as such.
    await _handleResetOrClose();
    rethrow;
  } catch (e) {
    // Log or handle other errors
    print('Error during closeWrite: $e');
    // Decide if this should also trigger _handleResetOrClose
  }
  // Note: closeWrite in MuxedStream doesn't free the stream.
  // The P2PStream contract implies that full close/reset is still needed.
}