I am working on a TCP client application. I would like to share my problem and want to know the
better design approcah for packet consumed in application.
Currently I have designed it as:
Consumer class, is activated once it received packet from socket.
PacketReceived event is fired by consumer class once it recognized and build up a valid packet.
All my forms (and User controls) which need to consume packet, has subscribed for this event to
get notified and then consume packets for interest by checking speficic packetID.
The bad thing about this design is that, it need to write event subscriptuion code and packetID
verification code on every form (and user control).
Is there any better way to get the job done, please suggest.
I am using C#.net, Framework 3.5.