Thank you all for your amazing replies. I still have one major question to ask concerning the actual messages been sent. In my case after i have sent the message type, i must send the actual message. Sometimes i have to sent an int after the message type, sometimes or in a different place in the program i have to send two int values after each other or sometime three int values after each other.
My question is how do i write the Message class so that it can accommodate different number of values that i have to send. Do i have to create for instance a Message class each for two integers, three integers etc..
Is there a way of creating one Message class that can accommodate sending different number of values.