Serialization of chat message.
Posted on 2010-09-10
I'm building a client/server chat program (I'm pretty sure some you guys may have seen some of my code around here, I've been asking a lot of questions about this... heh.) and everything is done with the server and client components that I've planned.
What is left is the serialization of the messages sent by the client to the server.
Can you guys point me to a way to do this in a text format?
I don't want to add any libraries to my program, need to do this with the standard libraries in C++. I have planned to do this with a class that has a Pack( ) and Unpack( ) functions, but I don't know how to begin with this. The serialization has to be something like this: [time] [username] [msg].
The way things will work is like this: before sending the message through the socket, the program will pack the message and send it, then on the server side the packed message will be received, unpacked and stored in a container.
Thanks in advance.