Say I have a structure:
struct person
{
char name[10];
int age;
};
struct car
{
int locationX;
int locationY;
};
struct company
{
vector<person> employees;
vector<car> cars;
};
For example, I want to send/recv the whole company using socket (UDP). So, send and recv once.
How can I do that? Could you please give me some code sinppet? How to send everything and read everything.
Thanks!
Take a look at Google protocol buffers http://code.google.com/apis/protocolbuffers/
as a lite alternative to Boost serialization.