flushQpackEncoderInstructions method
Flush pending QPACK encoder instructions to the encoder stream.
Returns the stream ID if instructions were sent, or null if the buffer
was empty.
Implementation
Future<int?> flushQpackEncoderInstructions() async {
final instructions = qpackEncoder.takeInstructions();
if (instructions.isEmpty) return null;
final builder = BytesBuilder();
for (final instruction in instructions) {
builder.add(instruction.serialize());
}
final bytes = builder.toBytes();
if (_encoderStreamId == null) {
await openQpackStreams();
}
return _openUnidirectionalStream(
StreamType.qpackEncoder,
Uint8List.fromList(bytes),
);
}