3 ms·
> So you also need to create heuristics, on how do you discard received data, until you get to a point where you can understand the stream again, and continue p
by kazinator 9y ago
> So you also need to create heuristics, on how do you discard received data, until you get to a point where you can understand the stream again, and continue processing.
This can be trivially easy for some data formats, where you know the absolute or relative offset of everything. E.g. here is a chunk of data I don't care about: 32 bit length followed by that many bytes. Read the length, then hit the llseek system call (that would be supported on sockets just for this feature) to skip the stream position that many bytes ahead. Done.