I want to send message from PC1 to PC2 via TCP socket. The question is, how can I tell the message received at PC2 is partial or complete? Or more specific, how to determine the start and end of a TCP message?
1) Add message length information at the start of a TCP message?
2) Add special flag bytes to the start and end of a TCP message?