every time i am writing some data to my server i first send a message containing a number which is suppose to tell the server how much data i am going to send.
For example before sending 1024 bytes, i need to first send the "1024" to the server then server can start reading for 1024 bytes. How can i make sure the first message (number of bytes) that i send to the server always has the same size? so for example always 8 bytes
server - reading 8 bytes
server - reading the number of bytes mentioned from last message
server - reading 8 bytes
server - reading the number of bytes mentioned from last message
...
...
...