Based on serialization (mentioned here https://stackoverflow.com/a/7849374/985798) I am trying to reengineer my small tcp application, which was using a string message until now.
But I ran into a small problem and I would like to know what solution you'd recommend me to use:
If I am trying to send more than one message in a very small interval, they will be merged in the "queue" and the client will receive both messages at the same time, which will end up with a single broken object. In the past I solved this problem with a string separator "|end|" and I was able to split it and process it in a foreach loop.
Is that a good approach? How would you solve that problem based on serialized object byte arrays? Would you use a byte[]
delimiter or use another solution?