Q on efficient network data handling

ikod geller.garry at gmail.com
Thu Jul 11 16:09:54 UTC 2019


Hello,

Several times I encountered one problem and each time I had to 
solve it again. As a result, I created the nbuff package, but 
maybe there is a ready solution and I wasted time?

The context is this - the program accepts data from the network 
and process it (examples are parsing HTTP headers, deserializing 
a network data stream, searching patterns in a network stream).

The problem is that the data comes in arbitrary chunks and you 
have to collect data into a continuous buffer(which means a lot 
of copying in memory) to use standard algorithms such as find, 
split, etc.

I made a nbuff package for myself that creates a buffer and keep 
unconcatenated data chunks, but support standard algorithms as it 
support several range properties.

How do you solve this problem? Is there something in std that can 
be used here?

Thanks!


More information about the Digitalmars-d mailing list