title: How can I defense from attackers who send junk data packet?
body: <p>I wrote a TCP socket program,and define a text protocol format like: "length|content",</p>
  
  <p>to make it simple, the "length" is always 1-byte-long and it define the number of bytes of "content"</p>
  
  <p>My problem is: </p>
  
  <p>when attackers send packets like "1|a51",it will stay in tcp's receive buffer
  the program will parse it wrong and the next packet would start like "5|1XXXX"，
  then the rest of the packets remain in the buffer would all parsed wrong，</p>
  
  <p>how to solve this problem?</p>