Boost logo

Boost :

From: Hamish Mackenzie (hamish_at_[hidden])
Date: 2002-11-25 19:33:43


On Mon, 2002-11-25 at 23:56, Boris Schäling wrote:
> > This looks like a blocking write to me. What if there was not enough
> > room in the buffer for this writen (say I wanted to do an HTTP post
> > including a 5GB file as the post data). You need an on_write member to
> > let you know when it is ok to do another write to the socket.
>
> stream::writen() calls ::write() to send the data to the network. If
> EWOULDBLOCK is returned the stream notifies the multiplexor to watch out for
> the socket descriptor to become writeable. Whenever that happens the
> multiplexor calls stream::write() (this one is different from
> stream::writen()) which calls ::write() again. Your proposed on_write() and
> the buffer exist in stream. Advantage: No action needs to be taken by the
> application developer.

How does the multiplexor know what to pass to write the second time?
Does the caller have to load the 5GB file into memory before passing it
to the write? What if I want to send a live video stream?

-- 
Hamish Mackenzie <hamish_at_[hidden]>

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