If you are writing a big program with alot of network traffic, where can I best handle my different packets? My packet contains a Packet ID which is connected to a big enum. For example packet LOGIN_AUTH is Packet ID 23.
How can I best seperate the handling of those packets?
- Make a huge switch statement with all the Packet ID's in there?
- Make a Packet class and make a extended class for each Packet ID?
I'm making my application in C#, but the question is more general.