
Hi Michel, I have also been putting together some ideas which are similar to those you outlined, though perhaps at a higher level of abstraction. I will try to wrap up what I have and post it in the next day or two. I will also try to look more closely at your code.
From a quick read, it looks similar to the implementation path I had used at my work, but probably more flexible in how event_dispatcher relates to event_handler. I think there is a good likelihood that the two are complementary.
Some philosophy questions: 1. Should the network library provide different choices of implementation to the user? For the most part, the platform will dictate the available solutions, so having the user decide would make their code non-portable. [my thought so far is no] 2. Would it be better perhaps to only provide behavior choices (sync, async, non-blocking) as part of the interface? [my thought is yes] Best, Don
There has been some discussion on this on the list lately. Is there anyone working on it. I have been pondering an interface that supports both async and blocking io combined. And an event dispatching model that can handle several types of dispatching mechanism through a the same interface to provide for a lot of differnet implementations.
At heart of this is an io_stream base class that should serve as base for classes like tcp_stream and udp_stream.
<code omitted>
So this is the outline of an interface that I think could serve as a foundation for a net library. I will try to go about and implement prototype for this using both select and iocp. But there are some things to iron out such as thread saftey and such (since it will necessary to at least having several threads blocking in dispatch_event at least the event_dispatcher would have to be thread safe and probably parts of the event source d).
What are your initial thaugths on this, implementatble? flexible enough? efficient enough?
What are you others doing in this field? And maybe we should do something together instead if we are sitting in different cornes hacking on something similar. I know for one i need help with boost.build, how to produce documentation according to boost standard, multi platform testing and the like ;).
__________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com