
Hi Stefan, --- Stefan Arentz <stefan.arentz@norad.org> wrote:
Or you could get the first 10 bytes in a new buffer and then 'compress' the original buffer. That way you can have sort of a ring buffer where you can take stuff of the beginning when you have received a full packet.
asio has the fixed_buffer template which does a similar sort of thing. It is used to implement the buffered_* templates that add buffering to sockets while retaining the interface.
Always when I use asio, I end up implementing something similar in my
code It would be nice if it were part of the standard asio library.
http://en.wikipedia.org/wiki/Java.nio#NIO_buffers
(Not saying that we should copy this, I'm just saying that it is good
functionality to have in a frmework that does network io)
Would you be able to share the C++ interface you have in mind for this? Cheers, Chris