I'm wondering how to use the tag parameter in methods such as
readDataWithTimeout: tag:
writeData: tag:
What happens if I want to use the tag to identify the type of packet ? For example is I say tag == 2 means that the packet is a message from a client, tag == 1 means that the packet is a message from the server ... If this is ok do I need to call readData: withTag: several times (once for each different tag) ?
[readDataWithTimeout:-1 tag:1];
[readDataWithTimeout:-1 tag:2];
Is there a way to say: "read every data without caring about the tag", and then in the didReadData: withTag: method handle the data according to the tag ?