Simple tutorials for complex subjects

Kagamin spam at here.lot
Tue Jun 5 13:33:18 UTC 2018


On Sunday, 3 June 2018 at 16:25:29 UTC, Ethan wrote:
> Step seven: In your receive function that takes a byte stream, 
> put in a switch statement that looks a little bit like the 
> following:
>
> switch( msg.GetID )
> {
>     static foreach( Message; ServerMessages )
>     {
>     case ObjectIDOf!Message:
>         Message deserialised = msg.FromBinary!Message;
>         this.receive( deserialised );
>     }
>     default:
>         break;
> }

Why message detection is in receiver instead of infrastructure? 
And why not gather message types from receiver's interface with 
DbI (like WCF does)?


More information about the Digitalmars-d mailing list