cancelStream method

void cancelStream(
  1. int id
)

Abort one stream: RST out; a pending recv wakes with CANCELLED.

Implementation

void cancelStream(int id) {
  final input = _streams.remove(id);
  if (input != null) {
    input.put(StreamEvent(EventKind.rst,
        status: StatusException(Wire.codeCancelled, 'call cancelled')));
    input.close();
  }
  try {
    sendFrame(Codec.statusFrame(Wire.frameRst, id,
        StatusException(Wire.codeCancelled, 'call cancelled')));
  } catch (_) {
    // Transport already gone; the local abort still stands.
  }
}