Boost logo

Boost :

From: Boris Schäling (boris_at_[hidden])
Date: 2002-11-27 14:13:38


> -----Original Message-----
> From: boost-bounces_at_[hidden]
> [mailto:boost-bounces_at_[hidden]]On Behalf Of Hamish Mackenzie
> Sent: Wednesday, November 27, 2002 5:00 PM
> To: Boost mailing list
> Subject: RE: [boost] Re: AW: Re: AW: Sockets
>
>
> [...]
> > My implementation selects on all file descriptors and calls all on_xxx
> > methods that must be called before it selects again on all file
> descriptors.
> > An on_xxx method must complete before another one is called. As
> every stream
> > uses its own buffers, one for reading, one for writing, I still
> don't see
> > any reentrancy problem?
>
> How big is the write buffer? Unlimited? If I loop around in on_connect
> calling writen with the contents of the 5GB file where will it all go?
> Or for that matter if 100 people connect and each ask to DL a 100MB
> file?

I use std::string as a buffer which grows when needed. This is sufficient
for what I do but may not what others need. You are right that there should
be better control of the buffers and/or an on_flush() method to notify the
observer when the buffer has been (partly) flushed and how much space is
available for another writen().

Boris


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk