The common error people make is misunderstanding the nature of TCP/IP. It's a stream-based protocol, not a record-based one.
You need to make sure that if you're the sender that you track how many bytes were actually sent, vs. how many you requested to be sent (you need to call Send again for the bytes that didn't go the first time).
If you're the recipient, you need to track how many bytes were actually received, and if you didn't get a complete record, you need to call Receive again. Note that you might get more bytes than make up a record -- you'll have to hold onto those until the next time your application needs to do a receive.
If you have variable-length records, you need to send the length of each record first (before the payload part). That way the recipient can know how big the record is, and know when they've received the correct number of bytes.
Chip H.
____________________________________________________________________
If you want to get the best response to a question, please read FAQ222-2244 first