sendResponse method

void sendResponse(
  1. int streamId,
  2. Http3Response response
)

Send an HTTP/3 response on streamId and store the encoded headers.

The response headers are encoded using the connection's QPACK encoder, which may emit dynamic table instructions that should be flushed via flushQpackEncoderInstructions.

Implementation

void sendResponse(int streamId, Http3Response response) {
  final headers = response.encodeHeaders(encoder: qpackEncoder);
  _sendHeaders(streamId, headers);
  if (response.body != null && response.body!.isNotEmpty) {
    _sendData(streamId, response.body!);
  }
}