|
Boost : |
From: Christopher Kohlhoff (chris_at_[hidden])
Date: 2005-08-19 07:07:37
Hi Stefan,
--- Stefan Arentz <stefan.arentz_at_[hidden]> 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
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk