dispatchAgentRead static method
Implementation
static void dispatchAgentRead(
Channel channel, Uint8List msg, ChannelInputCallback handleAgentPacket) {
channel.buf.add(msg);
while (channel.buf.data.length > 4) {
SerializableInput input = SerializableInput(channel.buf.data);
int agentPacketLen = input.getUint32();
if (input.remaining < agentPacketLen) break;
handleAgentPacket(
channel,
SerializableInput(
input.viewOffset(input.offset, input.offset + agentPacketLen)));
channel.buf.flush(agentPacketLen + 4);
}
}