From: Iain Hanson (Iain.Hanson_at_[hidden])
Date: 2005-04-22 09:35:03
On Thu, 2005-04-21 at 19:30 -0700, Jeff Garland wrote:
> I notice we don't have a buffer concept in any of our net/socket writeups on
> the wiki. I think that's a big omission. I also wonder if the abstraction
> doesn't already exist --> std::basic_streambuf. Let the socket class write
> into the streambuf and then you can trivially wrap a stream around it to do
> sophisticated i/o if you wish -- or simply pull out the raw chars....
A buffer concept is absolutely essential for TCP. Without it you will
run into delays with Nagle, delayed ack and slow start all combine-ing.
Streambuf makes sense for the iostream concept. For lower layers the
buffer concept needs to be a model of contiguous container. Iterator
type can only be guessed at because I don't know what goes on inside the
'C' socket lib or the kernel but first guess would be forward iterator.