From: Jody Hagins (jody-boost-011304_at_[hidden])
Date: 2005-12-29 17:51:34
On Fri, 30 Dec 2005 08:54:01 +1100 (EST)
Christopher Kohlhoff <chris_at_[hidden]> wrote:
> > However, of some concern is the fact that you call
> > epoll_wait() from multiple threads using the same epoll fd.
> Actually epoll_wait is only called from one thread at a time.
> This coordination is managed by the task_demuxer_service.
So, that class calls the impl run() method, and it makes sure it is only
entered once? What if a handler calls demuxer.run()?
> Maybe have a look at the chat or serialization examples, since
> the message format used in these programs is a fixed length
> header followed by a body.
You have an interface to read N bytes. What about an interface to read
until a message terminator is found?
> > async_read() does not provide the buffer to the handler. It
> > seems the only way to use it is with a function object that
> > contains the buffer. Is that a correct understanding, or do I
> > just need to go back to sleep?
> Binding it into the function object is one way. But often this
> binding is indirect, in the sense that you bind a this pointer
> and the buffer is a data member of the class.
But, what if I want to use a free function as my handler? I can't
because the data is not provided. Also, now I have coupled the start of
the read with its handling.
What about my earlier question of "keep reading and notifying me until
EOF?" That's not how I worded it, but let's say I have an application
and I want the same handler called for all IO until the socket is
closed. Right now, I *think* I have to keep creating async objects and
calls each time I process some data. This seems a bit wasteful. I'd
like to "reuse" the same handler without binding again, or I'd like to
just tell the framework... Keep calling this handler for every piece of
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk