TcpSocket sock;
// Do some initialization of sock here
sock.Put("-- BEGIN FRUIT LIST --\n");
for(int i = 0; i < FruitList.GetCount(); i++)
sock.Put(FruitList[i] + '\n');
sock.Put("-- END FRUIT LIST --\n");
On the other side you have to treat what's received like:
String line = sock.GetLine();
if(line == "-- BEGIN FRUIT LIST --")
{
while(line != "-- END FRUIT LIST --")
{
line = sock.GetLine();
FruitList.Add(line);
}
}
I think to send a full array U++ would require some kind of serialization of objects. I don't know if it already has it.