call method
Processes an incoming data fragment and returns complete messages.
Accumulates data in a buffer and uses the 5-byte prefix to extract complete messages. Can emit multiple messages from one fragment or keep buffering until a full message is available.
data New chunk of incoming data.
Returns the list of complete messages extracted.
Implementation
List<Uint8List> call(Uint8List data) {
try {
return _call(data);
} catch (e) {
// Rethrown to the owner, which answers the peer and decides whether this
// is a fault worth a record. Logging it here too made every refused
// frame an error, written by whichever peer sent it.
if (_logger.isInternal) {
_logger.internal('Failed to parse incoming data: $e');
}
rethrow;
}
}