I currently have a program that listens and sends on a TCP socket.
The problem I'm having is that I send a packet and sometimes it breaks into pieces. So my listening TCP socket class thinks the first piece that comes in is the entire payload.
What is the typical approach people take when programming with TCP connections?