Click here to Skip to main content
15,886,644 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more: , +
Hi,

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.

Now:
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.

Thanks.
Muhammad Idrees.
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900