
13 Dec
2005
13 Dec
'05
11:41 a.m.
Hi Simon, --- simon meiklejohn <simon@simonmeiklejohn.com> wrote:
Almost all my use cases for a network lib involve a lot of fan-out - ie branching based on the contents of a message, which gets implemented as client code deriving from an interface class such as <snip> I know that's not correct asio - but what's a recommended way to achieve this without wrapping each method of the interface.
I haven't really thought about it that deeply, but since you talk about a fan-out, cannot the dispatcher wrap be done on a function just before the fan-out occurs? I.e. a function that takes a complete message before a decision about what type it is has been made -- before the one becomes many? Cheers, Chris