You need to read the 4 byte size in order to know how many bytes to read. So don't subtract or you will lose the last 4 bytes of the message.
Regards...Ed
"Well done is better than well said." - Benjamin Franklin
In reply to Re^3: how to control segmented messages in TCP chat client
by flexvault
in thread how to control segmented messages in TCP chat client
by thanos1983
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |